WebInspector.BezierUI=function(width,height,marginTop,controlPointRadius,linearLine) {this.width=width;this.height=height;this.marginTop=marginTop;this.radius=controlPointRadius;this.linearLine=linearLine;} WebInspector.BezierUI.prototype={curveWidth:function() {return this.width-this.radius*2;},curveHeight:function() {return this.height-this.radius*2-this.marginTop*2;},_drawLine:function(parentElement,className,x1,y1,x2,y2) {var line=parentElement.createSVGChild("line",className);line.setAttribute("x1",x1+this.radius);line.setAttribute("y1",y1+this.radius+this.marginTop);line.setAttribute("x2",x2+this.radius);line.setAttribute("y2",y2+this.radius+this.marginTop);},_drawControlPoints:function(parentElement,startX,startY,controlX,controlY) {this._drawLine(parentElement,"bezier-control-line",startX,startY,controlX,controlY);var circle=parentElement.createSVGChild("circle","bezier-control-circle");circle.setAttribute("cx",controlX+this.radius);circle.setAttribute("cy",controlY+this.radius+this.marginTop);circle.setAttribute("r",this.radius);},drawCurve:function(bezier,svg) {if(!bezier) return;var width=this.curveWidth();var height=this.curveHeight();svg.setAttribute("width",this.width);svg.setAttribute("height",this.height);svg.removeChildren();var group=svg.createSVGChild("g");if(this.linearLine) this._drawLine(group,"linear-line",0,height,width,0);var curve=group.createSVGChild("path","bezier-path");var curvePoints=[new WebInspector.Geometry.Point(bezier.controlPoints[0].x*width+this.radius,(1-bezier.controlPoints[0].y)*height+this.radius+this.marginTop),new WebInspector.Geometry.Point(bezier.controlPoints[1].x*width+this.radius,(1-bezier.controlPoints[1].y)*height+this.radius+this.marginTop),new WebInspector.Geometry.Point(width+this.radius,this.marginTop+this.radius)];curve.setAttribute("d","M"+this.radius+","+(height+this.radius+this.marginTop)+" C"+curvePoints.join(" "));this._drawControlPoints(group,0,height,bezier.controlPoints[0].x*width,(1-bezier.controlPoints[0].y)*height);this._drawControlPoints(group,width,0,bezier.controlPoints[1].x*width,(1-bezier.controlPoints[1].y)*height);}} WebInspector.BezierUI.Height=32;WebInspector.BezierUI.drawVelocityChart=function(bezier,path,width) {var height=WebInspector.BezierUI.Height;var pathBuilder=["M",0,height];const sampleSize=1/40;var prev=bezier.evaluateAt(0);for(var t=sampleSize;t<1+sampleSize;t+=sampleSize){var current=bezier.evaluateAt(t);var slope=(current.y-prev.y)/(current.x-prev.x);var weightedX=prev.x*(1-t)+current.x*t;slope=Math.tanh(slope/1.5);pathBuilder=pathBuilder.concat(["L",(weightedX*width).toFixed(2),(height-slope*height).toFixed(2)]);prev=current;} pathBuilder=pathBuilder.concat(["L",width.toFixed(2),height,"Z"]);path.setAttribute("d",pathBuilder.join(" "));};WebInspector.StylesPopoverHelper=function() {this._popover=new WebInspector.Popover();this._popover.setCanShrink(false);this._popover.setNoMargins(true);this._popover.element.addEventListener("mousedown",consumeEvent,false);this._hideProxy=this.hide.bind(this,true);this._boundOnKeyDown=this._onKeyDown.bind(this);this._repositionBound=this._reposition.bind(this);this._boundFocusOut=this._onFocusOut.bind(this);} WebInspector.StylesPopoverHelper.prototype={_onFocusOut:function(event) {if(!event.relatedTarget||event.relatedTarget.isSelfOrDescendant(this._view.contentElement)) return;this._hideProxy();},isShowing:function() {return this._popover.isShowing();},show:function(view,anchorElement,hiddenCallback) {if(this._popover.isShowing()){if(this._anchorElement===anchorElement) return;this.hide(true);} delete this._isHidden;this._anchorElement=anchorElement;this._view=view;this._hiddenCallback=hiddenCallback;this._reposition();var document=this._popover.element.ownerDocument;document.addEventListener("mousedown",this._hideProxy,false);document.defaultView.addEventListener("resize",this._hideProxy,false);this._view.contentElement.addEventListener("keydown",this._boundOnKeyDown,false);this._scrollerElement=anchorElement.enclosingNodeOrSelfWithClass("style-panes-wrapper");if(this._scrollerElement) this._scrollerElement.addEventListener("scroll",this._repositionBound,false);},_reposition:function(event) {if(!this._previousFocusElement) this._previousFocusElement=WebInspector.currentFocusElement();this._view.contentElement.removeEventListener("focusout",this._boundFocusOut,false);this._popover.showView(this._view,this._anchorElement);this._view.contentElement.addEventListener("focusout",this._boundFocusOut,false);WebInspector.setCurrentFocusElement(this._view.contentElement);},hide:function(commitEdit) {if(this._isHidden) return;var document=this._popover.element.ownerDocument;this._isHidden=true;this._popover.hide();if(this._scrollerElement) this._scrollerElement.removeEventListener("scroll",this._repositionBound,false);document.removeEventListener("mousedown",this._hideProxy,false);document.defaultView.removeEventListener("resize",this._hideProxy,false);if(this._hiddenCallback) this._hiddenCallback.call(null,!!commitEdit);WebInspector.setCurrentFocusElement(this._previousFocusElement);delete this._previousFocusElement;delete this._anchorElement;if(this._view){this._view.detach();this._view.contentElement.removeEventListener("keydown",this._boundOnKeyDown,false);this._view.contentElement.removeEventListener("focusout",this._boundFocusOut,false);delete this._view;}},_onKeyDown:function(event) {if(event.keyIdentifier==="Enter"){this.hide(true);event.consume(true);return;} if(event.keyIdentifier==="U+001B"){this.hide(false);event.consume(true);}},__proto__:WebInspector.Object.prototype} WebInspector.BezierPopoverIcon=function(treeElement,stylesPopoverHelper,text) {this._treeElement=treeElement;this._stylesPopoverHelper=stylesPopoverHelper;this._createDOM(text);this._boundBezierChanged=this._bezierChanged.bind(this);} WebInspector.BezierPopoverIcon.prototype={element:function() {return this._element;},_createDOM:function(text) {this._element=createElement("nobr");this._element.title=WebInspector.UIString("Click to open a cubic bezier editor.");this._iconElement=this._element.createSVGChild("svg","popover-icon bezier-icon");this._iconElement.setAttribute("height",10);this._iconElement.setAttribute("width",10);this._iconElement.addEventListener("click",this._iconClick.bind(this),false);var g=this._iconElement.createSVGChild("g");var path=g.createSVGChild("path");path.setAttribute("d","M2,8 C2,3 8,7 8,2");this._bezierValueElement=this._element.createChild("span");this._bezierValueElement.textContent=text;},_iconClick:function(event) {event.consume(true);if(this._stylesPopoverHelper.isShowing()){this._stylesPopoverHelper.hide(true);return;} this._bezierEditor=new WebInspector.BezierEditor();var geometry=WebInspector.Geometry.CubicBezier.parse(this._bezierValueElement.textContent);this._bezierEditor.setBezier(geometry);this._bezierEditor.addEventListener(WebInspector.BezierEditor.Events.BezierChanged,this._boundBezierChanged);this._stylesPopoverHelper.show(this._bezierEditor,this._iconElement,this._onPopoverHidden.bind(this));this._originalPropertyText=this._treeElement.property.propertyText;this._treeElement.parentPane().setEditingStyle(true);},_bezierChanged:function(event) {this._bezierValueElement.textContent=(event.data);this._treeElement.applyStyleText(this._treeElement.renderedPropertyText(),false);},_onPopoverHidden:function(commitEdit) {this._bezierEditor.removeEventListener(WebInspector.BezierEditor.Events.BezierChanged,this._boundBezierChanged);delete this._bezierEditor;var propertyText=commitEdit?this._treeElement.renderedPropertyText():this._originalPropertyText;this._treeElement.applyStyleText(propertyText,true);this._treeElement.parentPane().setEditingStyle(false);delete this._originalPropertyText;}} WebInspector.ColorSwatchPopoverIcon=function(treeElement,stylesPopoverHelper,colorText) {this._treeElement=treeElement;this._stylesPopoverHelper=stylesPopoverHelper;this._swatch=WebInspector.ColorSwatch.create();this._swatch.setColorText(colorText);this._swatch.setFormat(WebInspector.ColorSwatchPopoverIcon._colorFormat(this._swatch.color()));var shiftClickMessage=WebInspector.UIString("Shift-click to change color format.");this._swatch.iconElement().title=String.sprintf("%s\n%s",WebInspector.UIString("Click to open a colorpicker."),shiftClickMessage);this._swatch.iconElement().addEventListener("click",this._iconClick.bind(this));this._boundSpectrumChanged=this._spectrumChanged.bind(this);} WebInspector.ColorSwatchPopoverIcon._colorFormat=function(color) {const cf=WebInspector.Color.Format;var format;var formatSetting=WebInspector.moduleSetting("colorFormat").get();if(formatSetting===cf.Original) format=cf.Original;else if(formatSetting===cf.RGB) format=(color.hasAlpha()?cf.RGBA:cf.RGB);else if(formatSetting===cf.HSL) format=(color.hasAlpha()?cf.HSLA:cf.HSL);else if(!color.hasAlpha()) format=(color.canBeShortHex()?cf.ShortHEX:cf.HEX);else format=cf.RGBA;return format;} WebInspector.ColorSwatchPopoverIcon.prototype={element:function() {return this._swatch;},_iconClick:function(event) {event.consume(true);if(this._stylesPopoverHelper.isShowing()){this._stylesPopoverHelper.hide(true);return;} var color=this._swatch.color();var format=this._swatch.format();if(format===WebInspector.Color.Format.Original) format=color.format();this._spectrum=new WebInspector.Spectrum();this._spectrum.setColor(color,format);this._spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged,this._boundSpectrumChanged);this._stylesPopoverHelper.show(this._spectrum,this._swatch.iconElement(),this._onPopoverHidden.bind(this));this._originalPropertyText=this._treeElement.property.propertyText;this._treeElement.parentPane().setEditingStyle(true);},_spectrumChanged:function(event) {var colorString=(event.data);this._swatch.setColorText(colorString);this._treeElement.applyStyleText(this._treeElement.renderedPropertyText(),false);},_onPopoverHidden:function(commitEdit) {this._spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorChanged,this._boundSpectrumChanged);delete this._spectrum;var propertyText=commitEdit?this._treeElement.renderedPropertyText():this._originalPropertyText;this._treeElement.applyStyleText(propertyText,true);this._treeElement.parentPane().setEditingStyle(false);delete this._originalPropertyText;}};WebInspector.BezierEditor=function() {WebInspector.VBox.call(this,true);this.registerRequiredCSS("elements/bezierEditor.css");this.contentElement.tabIndex=0;this._previewElement=this.contentElement.createChild("div","bezier-preview-container");this._previewElement.createChild("div","bezier-preview-animation");this._previewElement.addEventListener("click",this._startPreviewAnimation.bind(this));this._previewOnion=this.contentElement.createChild("div","bezier-preview-onion");this._previewOnion.addEventListener("click",this._startPreviewAnimation.bind(this));this._outerContainer=this.contentElement.createChild("div","bezier-container");this._presetsContainer=this._outerContainer.createChild("div","bezier-presets");this._presetUI=new WebInspector.BezierUI(40,40,0,2,false);this._presetCategories=[];for(var i=0;i0.9);this._colorDragElement.style.backgroundColor=(this._color().asString(WebInspector.Color.Format.RGBA));var noAlpha=WebInspector.Color.fromHSVA(this._hsv.slice(0,3).concat(1));this._alphaElementBackground.style.backgroundImage=String.sprintf("linear-gradient(to right, rgba(0,0,0,0), %s)",noAlpha.asString(WebInspector.Color.Format.RGB));},_formatViewSwitch:function() {var cf=WebInspector.Color.Format;var format=cf.RGB;if(this._colorFormat===cf.RGB) format=cf.HSL;else if(this._colorFormat===cf.HSL&&!this._color().hasAlpha()) format=this._originalFormat===cf.ShortHEX?cf.ShortHEX:cf.HEX;this._innerSetColor(undefined,"",format,WebInspector.Spectrum._ChangeSource.Other);},_inputChanged:function(event) {function elementValue(element) {return element.value;} var inputElement=(event.currentTarget);var arrowKeyOrMouseWheelEvent=(event.keyIdentifier==="Up"||event.keyIdentifier==="Down"||event.type==="mousewheel");var pageKeyPressed=(event.keyIdentifier==="PageUp"||event.keyIdentifier==="PageDown");if(arrowKeyOrMouseWheelEvent||pageKeyPressed){var newValue=WebInspector.createReplacementString(inputElement.value,event);if(newValue){inputElement.value=newValue;inputElement.selectionStart=0;inputElement.selectionEnd=newValue.length;} event.consume(true);} const cf=WebInspector.Color.Format;var colorString;if(this._colorFormat===cf.HEX||this._colorFormat===cf.ShortHEX){colorString=this._hexValue.value;}else{var format=this._colorFormat===cf.RGB?"rgba":"hsla";var values=this._textValues.map(elementValue).join(",");colorString=String.sprintf("%s(%s)",format,values);} var color=WebInspector.Color.parse(colorString);if(!color) return;var hsv=color.hsva();if(this._colorFormat===cf.HEX||this._colorFormat===cf.ShortHEX) this._colorFormat=color.canBeShortHex()?cf.ShortHEX:cf.HEX;this._innerSetColor(hsv,colorString,undefined,WebInspector.Spectrum._ChangeSource.Input);},wasShown:function() {this._hueAlphaWidth=this._hueElement.offsetWidth;this.slideHelperWidth=this._hueSlider.offsetWidth/2;this.dragWidth=this._colorElement.offsetWidth;this.dragHeight=this._colorElement.offsetHeight;this._colorDragElementHeight=this._colorDragElement.offsetHeight/2;this._innerSetColor(undefined,undefined,undefined,WebInspector.Spectrum._ChangeSource.Model);this._toggleColorPicker(true);WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,WebInspector.ResourceTreeModel.EventTypes.ColorPicked,this._colorPicked,this);},willHide:function() {this._toggleColorPicker(false);WebInspector.targetManager.removeModelListener(WebInspector.ResourceTreeModel,WebInspector.ResourceTreeModel.EventTypes.ColorPicked,this._colorPicked,this);},_toggleColorPicker:function(enabled,event) {if(enabled===undefined) enabled=!this._colorPickerButton.toggled();this._colorPickerButton.setToggled(enabled);for(var target of WebInspector.targetManager.targets()) target.pageAgent().setColorPickerEnabled(enabled);},_colorPicked:function(event) {var rgbColor=(event.data);var rgba=[rgbColor.r,rgbColor.g,rgbColor.b,(rgbColor.a/2.55|0)/100];var color=WebInspector.Color.fromRGBA(rgba);this._innerSetColor(color.hsva(),"",undefined,WebInspector.Spectrum._ChangeSource.Other);InspectorFrontendHost.bringToFront();},__proto__:WebInspector.VBox.prototype};WebInspector.ElementsBreadcrumbs=function() {WebInspector.HBox.call(this,true);this.registerRequiredCSS("elements/breadcrumbs.css");this.crumbsElement=this.contentElement.createChild("div","crumbs");this.crumbsElement.addEventListener("mousemove",this._mouseMovedInCrumbs.bind(this),false);this.crumbsElement.addEventListener("mouseleave",this._mouseMovedOutOfCrumbs.bind(this),false);this._nodeSymbol=Symbol("node");} WebInspector.ElementsBreadcrumbs.Events={NodeSelected:"NodeSelected"} WebInspector.ElementsBreadcrumbs.prototype={wasShown:function() {this.update();},updateNodes:function(nodes) {if(!nodes.length) return;var crumbs=this.crumbsElement;for(var crumb=crumbs.firstChild;crumb;crumb=crumb.nextSibling){if(nodes.indexOf(crumb[this._nodeSymbol])!==-1){this.update(true);return;}}},setSelectedNode:function(node) {this._currentDOMNode=node;this.update();},_mouseMovedInCrumbs:function(event) {var nodeUnderMouse=event.target;var crumbElement=nodeUnderMouse.enclosingNodeOrSelfWithClass("crumb");var node=(crumbElement?crumbElement[this._nodeSymbol]:null);if(node) node.highlight();},_mouseMovedOutOfCrumbs:function(event) {if(this._currentDOMNode) WebInspector.DOMModel.hideDOMNodeHighlight();},update:function(force) {if(!this.isShowing()) return;var currentDOMNode=this._currentDOMNode;var crumbs=this.crumbsElement;var handled=false;var crumb=crumbs.firstChild;while(crumb){if(crumb[this._nodeSymbol]===currentDOMNode){crumb.classList.add("selected");handled=true;}else{crumb.classList.remove("selected");} crumb=crumb.nextSibling;} if(handled&&!force){this.updateSizes();return;} crumbs.removeChildren();var panel=this;function selectCrumb(event) {event.preventDefault();var crumb=(event.currentTarget);if(!crumb.classList.contains("collapsed")){this.dispatchEventToListeners(WebInspector.ElementsBreadcrumbs.Events.NodeSelected,crumb[this._nodeSymbol]);return;} if(crumb===panel.crumbsElement.firstChild){var currentCrumb=crumb;while(currentCrumb){var hidden=currentCrumb.classList.contains("hidden");var collapsed=currentCrumb.classList.contains("collapsed");if(!hidden&&!collapsed) break;crumb=currentCrumb;currentCrumb=currentCrumb.nextSiblingElement;}} this.updateSizes(crumb);} var boundSelectCrumb=selectCrumb.bind(this);for(var current=currentDOMNode;current;current=current.parentNode){if(current.nodeType()===Node.DOCUMENT_NODE) continue;crumb=createElementWithClass("span","crumb");crumb[this._nodeSymbol]=current;crumb.addEventListener("mousedown",boundSelectCrumb,false);var crumbTitle="";switch(current.nodeType()){case Node.ELEMENT_NODE:if(current.pseudoType()) crumbTitle="::"+current.pseudoType();else 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="";break;case Node.DOCUMENT_FRAGMENT_NODE:crumbTitle=current.shadowRootType()?"#shadow-root":current.nodeNameInCorrectCase();break;default:crumbTitle=current.nodeNameInCorrectCase();} if(!crumb.childNodes.length){var nameElement=createElement("span");nameElement.textContent=crumbTitle;crumb.appendChild(nameElement);crumb.title=crumbTitle;} if(current===currentDOMNode) crumb.classList.add("selected");crumbs.insertBefore(crumb,crumbs.firstChild);} this.updateSizes();},updateSizes:function(focusedCrumb) {if(!this.isShowing()) return;var crumbs=this.crumbsElement;if(!crumbs.firstChild) return;var selectedIndex=0;var focusedIndex=0;var selectedCrumb;for(var i=0;i0?0:crumbs.childNodes.length-1);while(index!==significantIndex){if(shrinkCrumbAtIndex(index)) return true;index+=(direction>0?1:-1);}}else{var startIndex=0;var endIndex=crumbs.childNodes.length-1;while(startIndex!=significantIndex||endIndex!=significantIndex){var startDistance=significantIndex-startIndex;var endDistance=endIndex-significantIndex;if(startDistance>=endDistance) var index=startIndex++;else var index=endIndex--;if(shrinkCrumbAtIndex(index)) return true;}} return false;} function coalesceCollapsedCrumbs() {var crumb=crumbs.firstChild;var collapsedRun=false;var newStartNeeded=false;var newEndNeeded=false;while(crumb){var hidden=crumb.classList.contains("hidden");if(!hidden){var collapsed=crumb.classList.contains("collapsed");if(collapsedRun&&collapsed){crumb.classList.add("hidden");crumb.classList.remove("compact");crumb.classList.remove("collapsed");if(crumb.classList.contains("start")){crumb.classList.remove("start");newStartNeeded=true;} if(crumb.classList.contains("end")){crumb.classList.remove("end");newEndNeeded=true;} continue;} collapsedRun=collapsed;if(newEndNeeded){newEndNeeded=false;crumb.classList.add("end");}}else{collapsedRun=true;} crumb=crumb.nextSibling;} if(newStartNeeded){crumb=crumbs.lastChild;while(crumb){if(!crumb.classList.contains("hidden")){crumb.classList.add("start");break;} crumb=crumb.previousSibling;}}} function compact(crumb) {if(crumb.classList.contains("hidden")) return;crumb.classList.add("compact");} function collapse(crumb,dontCoalesce) {if(crumb.classList.contains("hidden")) return;crumb.classList.add("collapsed");crumb.classList.remove("compact");if(!dontCoalesce) coalesceCollapsedCrumbs();} if(!focusedCrumb){if(makeCrumbsSmaller(compact,ChildSide)) return;if(makeCrumbsSmaller(collapse,ChildSide)) return;} if(makeCrumbsSmaller(compact,focusedCrumb?BothSides:AncestorSide)) return;if(makeCrumbsSmaller(collapse,focusedCrumb?BothSides:AncestorSide)) return;if(!selectedCrumb) return;compact(selectedCrumb);if(crumbsAreSmallerThanContainer()) return;collapse(selectedCrumb,true);},__proto__:WebInspector.HBox.prototype};WebInspector.ElementsSidebarPane=function(title) {WebInspector.SidebarPane.call(this,title);this._node=null;this._updateController=new WebInspector.ElementsSidebarPane._UpdateController(this,this.doUpdate.bind(this));WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode,this._nodeChanged,this);} WebInspector.ElementsSidebarPane.prototype={node:function() {return this._node;},cssModel:function() {return this._cssModel&&this._cssModel.isEnabled()?this._cssModel:null;},_nodeChanged:function(event) {this.setNode((event.data));},setNode:function(node) {this._node=node;this._updateTarget(node?node.target():null);this.update();},doUpdate:function(finishedCallback) {finishedCallback();},update:function() {this._updateController.update();},wasShown:function() {WebInspector.SidebarPane.prototype.wasShown.call(this);this._updateController.viewWasShown();},_updateTarget:function(target) {if(this._target===target) return;if(this._target){this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this.onCSSModelChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this.onCSSModelChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this.onCSSModelChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this.onCSSModelChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.PseudoStateForced,this.onCSSModelChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this.onCSSModelChanged,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.DOMMutated,this.onDOMModelChanged,this);this._target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized,this._onFrameResized,this);} this._target=target;if(target){this._cssModel=WebInspector.CSSStyleModel.fromTarget(target);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this.onCSSModelChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this.onCSSModelChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this.onCSSModelChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this.onCSSModelChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.PseudoStateForced,this.onCSSModelChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this.onCSSModelChanged,this);this._domModel=WebInspector.DOMModel.fromTarget(target);this._domModel.addEventListener(WebInspector.DOMModel.Events.DOMMutated,this.onDOMModelChanged,this);this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized,this._onFrameResized,this);}},_onFrameResized:function(event) {function refreshContents() {this.onFrameResizedThrottled();delete this._frameResizedTimer;} if(this._frameResizedTimer) clearTimeout(this._frameResizedTimer);this._frameResizedTimer=setTimeout(refreshContents.bind(this),100);},onDOMModelChanged:function(){},onCSSModelChanged:function(){},onFrameResizedThrottled:function(){},__proto__:WebInspector.SidebarPane.prototype} WebInspector.ElementsSidebarPane._UpdateController=function(view,doUpdate) {this._view=view;this._updateThrottler=new WebInspector.Throttler(100);this._updateWhenVisible=false;this._doUpdate=doUpdate;} WebInspector.ElementsSidebarPane._UpdateController.prototype={update:function() {this._updateWhenVisible=!this._view.isShowing();if(this._updateWhenVisible) return;this._updateThrottler.schedule(innerUpdate.bind(this));function innerUpdate(finishedCallback) {if(this._view.isShowing()) this._doUpdate.call(null,finishedCallback);else finishedCallback();}},viewWasShown:function() {if(this._updateWhenVisible) this.update();}};WebInspector.ElementsSidebarViewWrapperPane=function(title,widget) {WebInspector.SidebarPane.call(this,title);widget.show(this.element);} WebInspector.ElementsSidebarViewWrapperPane.prototype={__proto__:WebInspector.SidebarPane.prototype};WebInspector.ElementsTreeElement=function(node,elementCloseTag) {TreeElement.call(this);this._node=node;this._elementCloseTag=elementCloseTag;if(this._node.nodeType()==Node.ELEMENT_NODE&&!elementCloseTag) this._canAddAttributes=true;this._searchQuery=null;this._expandedChildrenLimit=WebInspector.ElementsTreeElement.InitialChildrenLimit;} WebInspector.ElementsTreeElement.InitialChildrenLimit=500;WebInspector.ElementsTreeElement.ForbiddenClosingTagElements=["area","base","basefont","br","canvas","col","command","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"].keySet();WebInspector.ElementsTreeElement.EditTagBlacklist=["html","head","body"].keySet();WebInspector.ElementsTreeElement.animateOnDOMUpdate=function(treeElement) {var tagName=treeElement.listItemElement.querySelector(".webkit-html-tag-name");WebInspector.runCSSAnimationOnce(tagName||treeElement.listItemElement,"dom-update-highlight");} WebInspector.ElementsTreeElement.visibleShadowRoots=function(node) {var roots=node.shadowRoots();if(roots.length&&!WebInspector.moduleSetting("showUAShadowDOM").get()) roots=roots.filter(filter);function filter(root) {return root.shadowRootType()===WebInspector.DOMNode.ShadowRootTypes.Author;} return roots;} WebInspector.ElementsTreeElement.canShowInlineText=function(node) {if(node.importedDocument()||node.templateContent()||WebInspector.ElementsTreeElement.visibleShadowRoots(node).length||node.hasPseudoElements()) return false;if(node.nodeType()!==Node.ELEMENT_NODE) return false;if(!node.firstChild||node.firstChild!==node.lastChild||node.firstChild.nodeType()!==Node.TEXT_NODE) return false;var textChild=node.firstChild;var maxInlineTextChildLength=80;if(textChild.nodeValue().length=0;--i) updateEntryHide(this._highlightResult[i]);delete this._highlightResult;},setInClipboard:function(inClipboard) {if(this._inClipboard===inClipboard) return;this._inClipboard=inClipboard;this.listItemElement.classList.toggle("in-clipboard",inClipboard);},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");}}},expandedChildrenLimit:function() {return this._expandedChildrenLimit;},setExpandedChildrenLimit:function(expandedChildrenLimit) {this._expandedChildrenLimit=expandedChildrenLimit;},updateSelection:function() {var listItemElement=this.listItemElement;if(!listItemElement) return;if(!this.selectionElement){this.selectionElement=createElement("div");this.selectionElement.className="selection selected";listItemElement.insertBefore(this.selectionElement,listItemElement.firstChild);} this.selectionElement.style.height=listItemElement.offsetHeight+"px";},onbind:function() {if(!this._elementCloseTag) this._node[this.treeOutline.treeElementSymbol()]=this;},onunbind:function() {if(this._node[this.treeOutline.treeElementSymbol()]===this) this._node[this.treeOutline.treeElementSymbol()]=null;},onattach:function() {if(this._hovered){this.updateSelection();this.listItemElement.classList.add("hovered");} this.updateTitle();this._preventFollowingLinksOnDoubleClick();this.listItemElement.draggable=true;},_preventFollowingLinksOnDoubleClick:function() {var links=this.listItemElement.querySelectorAll("li .webkit-html-tag > .webkit-html-attribute > .webkit-html-external-link, li .webkit-html-tag > .webkit-html-attribute > .webkit-html-resource-link");if(!links) return;for(var i=0;i=2) event.preventDefault();},ondblclick:function(event) {if(this._editing||this._elementCloseTag) return false;if(this._startEditingTarget((event.target))) return false;if(this.isExpandable()&&!this.expanded) this.expand();return false;},hasEditableNode:function() {return!this._node.isShadowRoot()&&!this._node.ancestorUserAgentShadowRoot();},_insertInLastAttributePosition:function(tag,node) {if(tag.getElementsByClassName("webkit-html-attribute").length>0) tag.insertBefore(node,tag.lastChild);else{var nodeName=tag.textContent.match(/^<(.*?)>$/)[1];tag.textContent='';tag.createTextChild('<'+nodeName);tag.appendChild(node);tag.createTextChild('>');} this.updateSelection();},_startEditingTarget:function(eventTarget) {if(this.treeOutline.selectedDOMNode()!=this._node) return false;if(this._node.nodeType()!=Node.ELEMENT_NODE&&this._node.nodeType()!=Node.TEXT_NODE) return false;if(this.treeOutline.pickNodeMode()) return false;var textNode=eventTarget.enclosingNodeOrSelfWithClass("webkit-html-text-node");if(textNode) return this._startEditingTextNode(textNode);var attribute=eventTarget.enclosingNodeOrSelfWithClass("webkit-html-attribute");if(attribute) return this._startEditingAttribute(attribute,eventTarget);var tagName=eventTarget.enclosingNodeOrSelfWithClass("webkit-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 treeElement=this._elementCloseTag?this.treeOutline.findTreeElement(this._node):this;contextMenu.appendItem(WebInspector.UIString.capitalize("Add ^attribute"),treeElement._addNewAttribute.bind(treeElement));var attribute=event.target.enclosingNodeOrSelfWithClass("webkit-html-attribute");var newAttribute=event.target.enclosingNodeOrSelfWithClass("add-attribute");if(attribute&&!newAttribute) contextMenu.appendItem(WebInspector.UIString.capitalize("Edit ^attribute"),this._startEditingAttribute.bind(this,attribute,event.target));contextMenu.appendSeparator();var pseudoSubMenu=contextMenu.appendSubMenuItem(WebInspector.UIString.capitalize("Force ^element ^state"));this._populateForcedPseudoStateItems(pseudoSubMenu,treeElement.node());contextMenu.appendSeparator();this.populateNodeContextMenu(contextMenu);this.populateScrollIntoView(contextMenu);},populateScrollIntoView:function(contextMenu) {contextMenu.appendSeparator();contextMenu.appendItem(WebInspector.UIString.capitalize("Scroll into ^view"),this._scrollIntoView.bind(this));},_populateForcedPseudoStateItems:function(subMenu,node) {const pseudoClasses=["active","hover","focus","visited"];var forcedPseudoState=node.getUserProperty(WebInspector.CSSStyleModel.PseudoStatePropertyName)||[];for(var i=0;i=0;subMenu.appendCheckboxItem(":"+pseudoClasses[i],setPseudoStateCallback.bind(null,pseudoClasses[i],!pseudoClassForced),pseudoClassForced,false);} function setPseudoStateCallback(pseudoState,enabled) {WebInspector.CSSStyleModel.fromNode(node).forcePseudoState(node,pseudoState,enabled);}},populateTextContextMenu:function(contextMenu,textNode) {if(!this._editing) contextMenu.appendItem(WebInspector.UIString.capitalize("Edit ^text"),this._startEditingTextNode.bind(this,textNode));this.populateNodeContextMenu(contextMenu);},populateNodeContextMenu:function(contextMenu) {var openTagElement=this._node[this.treeOutline.treeElementSymbol()]||this;var isEditable=this.hasEditableNode();if(isEditable&&!this._editing) contextMenu.appendItem(WebInspector.UIString("Edit as HTML"),openTagElement.toggleEditAsHTML.bind(openTagElement));var isShadowRoot=this._node.isShadowRoot();if(this._node.nodeType()===Node.ELEMENT_NODE) contextMenu.appendItem(WebInspector.UIString.capitalize("Copy CSS ^path"),this._copyCSSPath.bind(this));if(!isShadowRoot) contextMenu.appendItem(WebInspector.UIString("Copy XPath"),this._copyXPath.bind(this));if(!isShadowRoot){var treeOutline=this.treeOutline;contextMenu.appendSeparator();contextMenu.appendItem(WebInspector.UIString("Cut"),treeOutline.performCopyOrCut.bind(treeOutline,true,this._node),!this.hasEditableNode());contextMenu.appendItem(WebInspector.UIString("Copy"),treeOutline.performCopyOrCut.bind(treeOutline,false,this._node));contextMenu.appendItem(WebInspector.UIString("Paste"),treeOutline.pasteNode.bind(treeOutline,this._node),!treeOutline.canPaste(this._node));} if(isEditable) contextMenu.appendItem(WebInspector.UIString("Delete"),this.remove.bind(this));contextMenu.appendSeparator();},_startEditing:function() {if(this.treeOutline.selectedDOMNode()!==this._node) return;var listItem=this._listItemNode;if(this._canAddAttributes){var attribute=listItem.getElementsByClassName("webkit-html-attribute")[0];if(attribute) return this._startEditingAttribute(attribute,attribute.getElementsByClassName("webkit-html-attribute-value")[0]);return this._addNewAttribute();} if(this._node.nodeType()===Node.TEXT_NODE){var textNode=listItem.getElementsByClassName("webkit-html-text-node")[0];if(textNode) return this._startEditingTextNode(textNode);return;}},_addNewAttribute:function() {var container=createElement("span");this._buildAttributeDOM(container," ","",null);var attr=container.firstElementChild;attr.style.marginLeft="2px";attr.style.marginRight="2px";var tag=this.listItemElement.getElementsByClassName("webkit-html-tag")[0];this._insertInLastAttributePosition(tag,attr);attr.scrollIntoViewIfNeeded(true);return this._startEditingAttribute(attr,attr);},_triggerEditAttribute:function(attributeName) {var attributeElements=this.listItemElement.getElementsByClassName("webkit-html-attribute-name");for(var i=0,len=attributeElements.length;i"));removeZeroWidthSpaceRecursive(attribute);var config=new WebInspector.InplaceEditor.Config(this._attributeEditingCommitted.bind(this),this._editingCancelled.bind(this),attributeName);function postKeyDownFinishHandler(event) {WebInspector.handleElementValueModifications(event,attribute);return"";} config.setPostKeydownFinishHandler(postKeyDownFinishHandler);this._editing=WebInspector.InplaceEditor.startEditing(attribute,config);this.listItemElement.getComponentSelection().setBaseAndExtent(elementForSelection,0,elementForSelection,1);return true;},_startEditingTextNode:function(textNodeElement) {if(WebInspector.isBeingEdited(textNodeElement)) return true;var textNode=this._node;if(textNode.nodeType()===Node.ELEMENT_NODE&&textNode.firstChild) textNode=textNode.firstChild;var container=textNodeElement.enclosingNodeOrSelfWithClass("webkit-html-text-node");if(container) container.textContent=textNode.nodeValue();var config=new WebInspector.InplaceEditor.Config(this._textNodeEditingCommitted.bind(this,textNode),this._editingCancelled.bind(this));this._editing=WebInspector.InplaceEditor.startEditing(textNodeElement,config);this.listItemElement.getComponentSelection().setBaseAndExtent(textNodeElement,0,textNodeElement,1);return true;},_startEditingTagName:function(tagNameElement) {if(!tagNameElement){tagNameElement=this.listItemElement.getElementsByClassName("webkit-html-tag-name")[0];if(!tagNameElement) return false;} var tagName=tagNameElement.textContent;if(WebInspector.ElementsTreeElement.EditTagBlacklist[tagName.toLowerCase()]) return false;if(WebInspector.isBeingEdited(tagNameElement)) return true;var closingTagElement=this._distinctClosingTagElement();function keyupListener(event) {if(closingTagElement) closingTagElement.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.InplaceEditor.Config(editingComitted.bind(this),editingCancelled.bind(this),tagName);this._editing=WebInspector.InplaceEditor.startEditing(tagNameElement,config);this.listItemElement.getComponentSelection().setBaseAndExtent(tagNameElement,0,tagNameElement,1);return true;},_startEditingAsHTML:function(commitCallback,error,initialValue) {if(error) return;if(this._editing) return;function consume(event) {if(event.eventPhase===Event.AT_TARGET) event.consume(true);} initialValue=this._convertWhitespaceToEntities(initialValue).text;this._htmlEditElement=createElement("div");this._htmlEditElement.className="source-code elements-tree-editor";var child=this.listItemElement.firstChild;while(child){child.style.display="none";child=child.nextSibling;} if(this._childrenListNode) this._childrenListNode.style.display="none";this.listItemElement.appendChild(this._htmlEditElement);this.treeOutline.element.addEventListener("mousedown",consume,false);this.updateSelection();function commit(element,newValue) {commitCallback(initialValue,newValue);dispose.call(this);} function dispose() {delete this._editing;this.treeOutline.setMultilineEditing(null);this.listItemElement.removeChild(this._htmlEditElement);delete this._htmlEditElement;if(this._childrenListNode) this._childrenListNode.style.removeProperty("display");var child=this.listItemElement.firstChild;while(child){child.style.removeProperty("display");child=child.nextSibling;} this.treeOutline.element.removeEventListener("mousedown",consume,false);this.updateSelection();this.treeOutline.focus();} var config=new WebInspector.InplaceEditor.Config(commit.bind(this),dispose.bind(this));config.setMultilineOptions(initialValue,{name:"xml",htmlMode:true},"web-inspector-html",WebInspector.moduleSetting("domWordWrap").get(),true);WebInspector.InplaceEditor.startMultilineEditing(this._htmlEditElement,config).then(markAsBeingEdited.bind(this));function markAsBeingEdited(controller) {this._editing=(controller);this._editing.setWidth(this.treeOutline.visibleWidth());this.treeOutline.setMultilineEditing(this._editing);}},_attributeEditingCommitted:function(element,newText,oldText,attributeName,moveDirection) {delete this._editing;var treeOutline=this.treeOutline;function moveToNextAttributeIfNeeded(error) {if(error) this._editingCancelled(element,attributeName);if(!moveDirection) return;treeOutline.runPendingUpdates();var attributes=this._node.attributes();for(var i=0;i0) this._triggerEditAttribute(attributes[attributes.length-1].name);}else{if(attributes.length>1) this._triggerEditAttribute(attributes[attributes.length-2].name);}}else if(moveDirection==="forward"){if(!/^\s*$/.test(newText)) this._addNewAttribute();else this._startEditingTagName();}} if((attributeName.trim()||newText.trim())&&oldText!==newText){this._node.setAttribute(attributeName,newText,moveToNextAttributeIfNeeded.bind(this));return;} this.updateTitle();moveToNextAttributeIfNeeded.call(this);},_tagNameEditingCommitted:function(element,newText,oldText,tagName,moveDirection) {delete this._editing;var self=this;function cancel() {var closingTagElement=self._distinctClosingTagElement();if(closingTagElement) closingTagElement.textContent="";self._editingCancelled(element,tagName);moveToNextAttributeIfNeeded.call(self);} function moveToNextAttributeIfNeeded() {if(moveDirection!=="forward"){this._addNewAttribute();return;} var attributes=this._node.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 newTreeItem=treeOutline.selectNodeAfterEdit(wasExpanded,error,nodeId);moveToNextAttributeIfNeeded.call(newTreeItem);} this._node.setNodeName(newText,changeTagNameCallback);},_textNodeEditingCommitted:function(textNode,element,newText) {delete this._editing;function callback() {this.updateTitle();} textNode.setNodeValue(newText,callback.bind(this));},_editingCancelled:function(element,context) {delete this._editing;this.updateTitle();},_distinctClosingTagElement:function() {if(this.expanded){var closers=this._childrenListNode.querySelectorAll(".close");return closers[closers.length-1];} var tags=this.listItemElement.getElementsByClassName("webkit-html-tag");return(tags.length===1?null:tags[tags.length-1]);},updateTitle:function(updateRecord,onlySearchQueryChanged) {if(this._editing) return;if(onlySearchQueryChanged){this._hideSearchHighlight();}else{var nodeInfo=this._nodeTitleInfo(updateRecord||null);if(this._node.nodeType()===Node.DOCUMENT_FRAGMENT_NODE&&this._node.isInShadowTree()&&this._node.shadowRootType()){this.childrenListElement.classList.add("shadow-root");var depth=4;for(var node=this._node;depth&&node;node=node.parentNode){if(node.nodeType()===Node.DOCUMENT_FRAGMENT_NODE) depth--;} if(!depth) this.childrenListElement.classList.add("shadow-root-deep");else this.childrenListElement.classList.add("shadow-root-depth-"+depth);} var highlightElement=createElement("span");highlightElement.className="highlight";highlightElement.appendChild(nodeInfo);this.title=highlightElement;this._updateDecorations();delete this._highlightResult;} delete this.selectionElement;if(this.selected) this.updateSelection();this._preventFollowingLinksOnDoubleClick();this._highlightSearchResults();},_createDecoratorElement:function() {var node=this._node;var decoratorMessages=[];var parentDecoratorMessages=[];var decorators=this.treeOutline.nodeDecorators();for(var i=0;i0);var attrSpanElement=parentElement.createChild("span","webkit-html-attribute");var attrNameElement=attrSpanElement.createChild("span","webkit-html-attribute-name");attrNameElement.textContent=name;if(hasText) attrSpanElement.createTextChild("=\u200B\"");var attrValueElement=attrSpanElement.createChild("span","webkit-html-attribute-value");if(updateRecord&&updateRecord.isAttributeModified(name)) WebInspector.runCSSAnimationOnce(hasText?attrValueElement:attrNameElement,"dom-update-highlight");function linkifyValue(value) {var rewrittenHref=node.resolveURL(value);if(rewrittenHref===null){var span=createElement("span");setValueWithEntities.call(this,span,value);return span;} value=value.replace(closingPunctuationRegex,"$&\u200B");if(value.startsWith("data:")) value=value.trimMiddle(60);var anchor=WebInspector.linkifyURLAsNode(rewrittenHref,value,"",node.nodeName().toLowerCase()==="a");anchor.preventFollow=true;return anchor;} if(node&&name==="src"||name==="href"){attrValueElement.appendChild(linkifyValue.call(this,value));}else if(node&&node.nodeName().toLowerCase()==="img"&&name==="srcset"){var sources=value.split(",");for(var i=0;i0) attrValueElement.createTextChild(", ");var source=sources[i].trim();var indexOfSpace=source.indexOf(" ");var url=source.substring(0,indexOfSpace);var tail=source.substring(indexOfSpace);attrValueElement.appendChild(linkifyValue.call(this,url));attrValueElement.createTextChild(tail);}}else{setValueWithEntities.call(this,attrValueElement,value);} if(hasText) attrSpanElement.createTextChild("\"");},_buildPseudoElementDOM:function(parentElement,pseudoElementName) {var pseudoElement=parentElement.createChild("span","webkit-html-pseudo-element");pseudoElement.textContent="::"+pseudoElementName;parentElement.createTextChild("\u200B");},_buildTagDOM:function(parentElement,tagName,isClosingTag,isDistinctTreeElement,updateRecord) {var node=this._node;var classes=["webkit-html-tag"];if(isClosingTag&&isDistinctTreeElement) classes.push("close");var tagElement=parentElement.createChild("span",classes.join(" "));tagElement.createTextChild("<");var tagNameElement=tagElement.createChild("span",isClosingTag?"":"webkit-html-tag-name");tagNameElement.textContent=(isClosingTag?"/":"")+tagName;if(!isClosingTag){if(node.hasAttributes()){var attributes=node.attributes();for(var i=0;i");parentElement.createTextChild("\u200B");},_convertWhitespaceToEntities:function(text) {var result="";var lastIndexAfterEntity=0;var entityRanges=[];var charToEntity=WebInspector.ElementsTreeOutline.MappedCharToEntity;for(var i=0,size=text.length;i");break;case Node.DOCUMENT_TYPE_NODE:var docTypeElement=titleDOM.createChild("span","webkit-html-doctype");docTypeElement.createTextChild("");break;case Node.CDATA_SECTION_NODE:var cdataElement=titleDOM.createChild("span","webkit-html-text-node");cdataElement.createTextChild("");break;case Node.DOCUMENT_FRAGMENT_NODE:var fragmentElement=titleDOM.createChild("span","webkit-html-fragment");fragmentElement.textContent=node.nodeNameInCorrectCase().collapseWhitespace();break;default:titleDOM.createTextChild(node.nodeNameInCorrectCase().collapseWhitespace());} function updateSearchHighlight() {delete this._highlightResult;this._highlightSearchResults();} return titleDOM;},remove:function() {if(this._node.pseudoType()) return;var parentElement=this.parent;if(!parentElement) return;if(!this._node.parentNode||this._node.parentNode.nodeType()===Node.DOCUMENT_NODE) return;this._node.removeNode();},toggleEditAsHTML:function(callback) {if(this._editing&&this._htmlEditElement&&WebInspector.isBeingEdited(this._htmlEditElement)){this._editing.commit();return;} function selectNode(error) {if(callback) callback(!error);} function commitChange(initialValue,value) {if(initialValue!==value) node.setOuterHTML(value,selectNode);} var node=this._node;node.getOuterHTML(this._startEditingAsHTML.bind(this,commitChange));},_copyCSSPath:function() {InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.cssPath(this._node,true));},_copyXPath:function() {InspectorFrontendHost.copyText(WebInspector.DOMPresentationUtils.xPath(this._node,true));},_highlightSearchResults:function() {if(!this._searchQuery||!this._searchHighlightsVisible) return;this._hideSearchHighlight();var text=this.listItemElement.textContent;var regexObject=createPlainTextSearchRegex(this._searchQuery,"gi");var match=regexObject.exec(text);var matchRanges=[];while(match){matchRanges.push(new WebInspector.SourceRange(match.index,match[0].length));match=regexObject.exec(text);} if(!matchRanges.length) matchRanges.push(new WebInspector.SourceRange(0,text.length));this._highlightResult=[];WebInspector.highlightSearchResults(this.listItemElement,matchRanges,this._highlightResult);},_scrollIntoView:function() {function scrollIntoViewCallback(object) {function scrollIntoView() {this.scrollIntoViewIfNeeded(true);} if(object) object.callFunction(scrollIntoView);} this._node.resolveToObject("",scrollIntoViewCallback);},__proto__:TreeElement.prototype};WebInspector.ElementsTreeOutline=function(domModel,omitRootDOMNode,selectEnabled) {this._domModel=domModel;this._treeElementSymbol=Symbol("treeElement");var element=createElement("div");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(element);this._shadowRoot.appendChild(WebInspector.Widget.createStyleElement("elements/elementsTreeOutline.css"));var outlineDisclosureElement=this._shadowRoot.createChild("div","elements-disclosure");TreeOutline.call(this);this._element=this.element;this._element.classList.add("elements-tree-outline","source-code");this._element.addEventListener("mousedown",this._onmousedown.bind(this),false);this._element.addEventListener("mousemove",this._onmousemove.bind(this),false);this._element.addEventListener("mouseleave",this._onmouseleave.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.addEventListener("keydown",this._onkeydown.bind(this),false);this._element.addEventListener("webkitAnimationEnd",this._onAnimationEnd.bind(this),false);this._element.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),false);outlineDisclosureElement.appendChild(this._element);this.element=element;this._includeRootDOMNode=!omitRootDOMNode;this._selectEnabled=selectEnabled;this._rootDOMNode=null;this._selectedDOMNode=null;this._visible=false;this._pickNodeMode=false;this._createNodeDecorators();this._popoverHelper=new WebInspector.PopoverHelper(this._element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this._popoverHelper.setTimeout(0);this._updateRecords=new Map();this._treeElementsBeingUpdated=new Set();} WebInspector.ElementsTreeOutline.ClipboardData;WebInspector.ElementsTreeOutline.Events={NodePicked:"NodePicked",SelectedNodeChanged:"SelectedNodeChanged",ElementsTreeUpdated:"ElementsTreeUpdated"} WebInspector.ElementsTreeOutline.MappedCharToEntity={"\u00a0":"nbsp","\u0093":"#147","\u00ad":"shy","\u2002":"ensp","\u2003":"emsp","\u2009":"thinsp","\u200a":"#8202","\u200b":"#8203","\u200c":"zwnj","\u200d":"zwj","\u200e":"lrm","\u200f":"rlm","\u202a":"#8234","\u202b":"#8235","\u202c":"#8236","\u202d":"#8237","\u202e":"#8238","\ufeff":"#65279"} WebInspector.ElementsTreeOutline.prototype={treeElementSymbol:function() {return this._treeElementSymbol;},focus:function() {this._element.focus();},hasFocus:function() {return this._element===WebInspector.currentFocusElement();},setWordWrap:function(wrap) {this._element.classList.toggle("elements-tree-nowrap",!wrap);},_onAnimationEnd:function(event) {event.target.classList.remove("elements-tree-element-pick-node-1");event.target.classList.remove("elements-tree-element-pick-node-2");},pickNodeMode:function() {return this._pickNodeMode;},setPickNodeMode:function(value) {this._pickNodeMode=value;this._element.classList.toggle("pick-node-mode",value);},handlePickNode:function(element,node) {if(!this._pickNodeMode) return false;this.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.NodePicked,node);var hasRunningAnimation=element.classList.contains("elements-tree-element-pick-node-1")||element.classList.contains("elements-tree-element-pick-node-2");element.classList.toggle("elements-tree-element-pick-node-1");if(hasRunningAnimation) element.classList.toggle("elements-tree-element-pick-node-2");return true;},domModel:function() {return this._domModel;},setMultilineEditing:function(multilineEditing) {this._multilineEditing=multilineEditing;},visibleWidth:function() {return this._visibleWidth;},setVisibleWidth:function(width) {this._visibleWidth=width;if(this._multilineEditing) this._multilineEditing.setWidth(this._visibleWidth);},nodeDecorators:function() {return this._nodeDecorators;},_createNodeDecorators:function() {this._nodeDecorators=[];this._nodeDecorators.push(new WebInspector.ElementsTreeOutline.PseudoStateDecorator());},_setClipboardData:function(data) {if(this._clipboardNodeData){var treeElement=this.findTreeElement(this._clipboardNodeData.node);if(treeElement) treeElement.setInClipboard(false);delete this._clipboardNodeData;} if(data){var treeElement=this.findTreeElement(data.node);if(treeElement) treeElement.setInClipboard(true);this._clipboardNodeData=data;}},resetClipboardIfNeeded:function(removedNode) {if(this._clipboardNodeData&&this._clipboardNodeData.node===removedNode) this._setClipboardData(null);},handleCopyOrCutKeyboardEvent:function(isCut,event) {this._setClipboardData(null);if(!event.target.isComponentSelectionCollapsed()) return;if(WebInspector.isEditing()) return;var targetNode=this.selectedDOMNode();if(!targetNode) return;event.clipboardData.clearData();event.preventDefault();this.performCopyOrCut(isCut,targetNode);},performCopyOrCut:function(isCut,node) {if(isCut&&(node.isShadowRoot()||node.ancestorUserAgentShadowRoot())) return;node.copyNode();this._setClipboardData({node:node,isCut:isCut});},canPaste:function(targetNode) {if(targetNode.isShadowRoot()||targetNode.ancestorUserAgentShadowRoot()) return false;if(!this._clipboardNodeData) return false;var node=this._clipboardNodeData.node;if(this._clipboardNodeData.isCut&&(node===targetNode||node.isAncestor(targetNode))) return false;if(targetNode.target()!==node.target()) return false;return true;},pasteNode:function(targetNode) {if(this.canPaste(targetNode)) this._performPaste(targetNode);},handlePasteKeyboardEvent:function(event) {if(WebInspector.isEditing()) return;var targetNode=this.selectedDOMNode();if(!targetNode||!this.canPaste(targetNode)) return;event.preventDefault();this._performPaste(targetNode);},_performPaste:function(targetNode) {if(this._clipboardNodeData.isCut){this._clipboardNodeData.node.moveTo(targetNode,null,expandCallback.bind(this));this._setClipboardData(null);}else{this._clipboardNodeData.node.copyTo(targetNode,null,expandCallback.bind(this));} function expandCallback(error,nodeId) {if(error) return;var pastedNode=this._domModel.nodeForId(nodeId);if(!pastedNode) return;this.selectDOMNode(pastedNode);}},setVisible:function(visible) {this._visible=visible;if(!this._visible){this._popoverHelper.hidePopover();if(this._multilineEditing) this._multilineEditing.cancel();return;} this.runPendingUpdates();if(this._selectedDOMNode) this._revealAndSelectNode(this._selectedDOMNode,false);},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);if(this._selectedDOMNode===node) this._selectedNodeChanged();},editing:function() {var node=this.selectedDOMNode();if(!node) return false;var treeElement=this.findTreeElement(node);if(!treeElement) return false;return treeElement.isEditing()||false;},update:function() {var selectedTreeElement=this.selectedTreeElement;if(!(selectedTreeElement instanceof WebInspector.ElementsTreeElement)) selectedTreeElement=null;var selectedNode=selectedTreeElement?selectedTreeElement.node():null;this.removeChildren();if(!this.rootDOMNode) return;var treeElement;if(this._includeRootDOMNode){treeElement=this._createElementTreeElement(this.rootDOMNode);this.appendChild(treeElement);}else{var node=this.rootDOMNode.firstChild;while(node){treeElement=this._createElementTreeElement(node);this.appendChild(treeElement);node=node.nextSibling;}} if(selectedNode) this._revealAndSelectNode(selectedNode,true);},updateSelection:function() {if(!this.selectedTreeElement) return;var element=this.selectedTreeElement;element.updateSelection();},updateOpenCloseTags:function(node) {var treeElement=this.findTreeElement(node);if(treeElement) treeElement.updateTitle(this._updateRecordForHighlight(node));var closingTagElement=treeElement.lastChild();if(closingTagElement&&closingTagElement.isClosingTag()) closingTagElement.updateTitle(this._updateRecordForHighlight(node));},_selectedNodeChanged:function() {this.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedDOMNode);},_fireElementsTreeUpdated:function(nodes) {this.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated,nodes);},findTreeElement:function(node) {var treeElement=this._lookUpTreeElement(node);if(!treeElement&&node.nodeType()===Node.TEXT_NODE){treeElement=this._lookUpTreeElement(node.parentNode);} return(treeElement);},_lookUpTreeElement:function(node) {if(!node) return null;var cachedElement=node[this._treeElementSymbol];if(cachedElement) return cachedElement;var ancestors=[];for(var currentNode=node.parentNode;currentNode;currentNode=currentNode.parentNode){ancestors.push(currentNode);if(currentNode[this._treeElementSymbol]) break;} if(!currentNode) return null;for(var i=ancestors.length-1;i>=0;--i){var treeElement=ancestors[i][this._treeElementSymbol];if(treeElement) treeElement.onpopulate();} return node[this._treeElementSymbol];},createTreeElementFor:function(node) {var treeElement=this.findTreeElement(node);if(treeElement) return treeElement;if(!node.parentNode) return null;treeElement=this.createTreeElementFor(node.parentNode);return treeElement?this._showChild(treeElement,node):null;},set suppressRevealAndSelect(x) {if(this._suppressRevealAndSelect===x) return;this._suppressRevealAndSelect=x;},_revealAndSelectNode:function(node,omitFocus) {if(this._suppressRevealAndSelect) return;if(!this._includeRootDOMNode&&node===this.rootDOMNode&&this.rootDOMNode) node=this.rootDOMNode.firstChild;if(!node) return;var treeElement=this.createTreeElementFor(node);if(!treeElement) return;treeElement.revealAndSelect(omitFocus);},_treeElementFromEvent:function(event) {var scrollContainer=this.element.parentElement;var x=scrollContainer.totalOffsetLeft()+scrollContainer.offsetWidth-36;var y=event.pageY;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;},_getPopoverAnchor:function(element,event) {var anchor=element.enclosingNodeOrSelfWithClass("webkit-html-resource-link");if(!anchor||!anchor.href) return;return anchor;},_loadDimensionsForNode:function(node,callback) {if(!node.nodeName()||node.nodeName().toLowerCase()!=="img"){callback();return;} node.resolveToObject("",resolvedNode);function resolvedNode(object) {if(!object){callback();return;} object.callFunctionJSON(features,undefined,callback);object.release();function features() {return{offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,currentSrc:this.currentSrc};}}},_showPopover:function(anchor,popover) {var listItem=anchor.enclosingNodeOrSelfWithNodeName("li");var node=(listItem.treeElement).node();this._loadDimensionsForNode(node,WebInspector.DOMPresentationUtils.buildImagePreviewContents.bind(WebInspector.DOMPresentationUtils,node.target(),anchor.href,true,showPopover));function showPopover(contents) {if(!contents) return;popover.setCanShrink(false);popover.showForAnchor(contents,anchor);}},_onmousedown:function(event) {var element=this._treeElementFromEvent(event);if(!element||element.isEventWithinDisclosureTriangle(event)) 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;} if(element instanceof WebInspector.ElementsTreeElement){this._domModel.highlightDOMNodeWithConfig(element.node().id,{mode:"all",showInfo:!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)});return;} if(element instanceof WebInspector.ElementsTreeOutline.ShortcutTreeElement) this._domModel.highlightDOMNodeWithConfig(undefined,{mode:"all",showInfo:!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)},element.backendNodeId());},_onmouseleave:function(event) {if(this._previousHoveredElement){this._previousHoveredElement.hovered=false;delete this._previousHoveredElement;} WebInspector.DOMModel.hideDOMNodeHighlight();},_ondragstart:function(event) {if(!event.target.isComponentSelectionCollapsed()) return false;if(event.target.nodeName==="A") return false;var treeElement=this._treeElementFromEvent(event);if(!this._isValidDragSourceOrTarget(treeElement)) return false;if(treeElement.node().nodeName()==="BODY"||treeElement.node().nodeName()==="HEAD") return false;event.dataTransfer.setData("text/plain",treeElement.listItemElement.textContent.replace(/\u200b/g,""));event.dataTransfer.effectAllowed="copyMove";this._treeElementBeingDragged=treeElement;WebInspector.DOMModel.hideDOMNodeHighlight();return true;},_ondragover:function(event) {if(!this._treeElementBeingDragged) return false;var treeElement=this._treeElementFromEvent(event);if(!this._isValidDragSourceOrTarget(treeElement)) return false;var node=treeElement.node();while(node){if(node===this._treeElementBeingDragged._node) 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;if(!(treeElement instanceof WebInspector.ElementsTreeElement)) return false;var elementsTreeElement=(treeElement);var node=elementsTreeElement.node();if(!node.parentNode||node.parentNode.nodeType()!==Node.ELEMENT_NODE) return false;return true;},_ondrop:function(event) {event.preventDefault();var treeElement=this._treeElementFromEvent(event);if(treeElement) this._doMove(treeElement);},_doMove:function(treeElement) {if(!this._treeElementBeingDragged) return;var parentNode;var anchorNode;if(treeElement.isClosingTag()){parentNode=treeElement.node();}else{var dragTargetNode=treeElement.node();parentNode=dragTargetNode.parentNode;anchorNode=dragTargetNode;} var wasExpanded=this._treeElementBeingDragged.expanded;this._treeElementBeingDragged._node.moveTo(parentNode,anchorNode,this.selectNodeAfterEdit.bind(this,wasExpanded));delete this._treeElementBeingDragged;},_ondragend:function(event) {event.preventDefault();this._clearDragOverTreeElementMarker();delete this._treeElementBeingDragged;},_clearDragOverTreeElementMarker:function() {if(this._dragOverTreeElement){this._dragOverTreeElement.updateSelection();this._dragOverTreeElement.listItemElement.classList.remove("elements-drag-over");delete this._dragOverTreeElement;}},_onkeydown:function(event) {var keyboardEvent=(event);var node=(this.selectedDOMNode());console.assert(node);var treeElement=node[this._treeElementSymbol];if(!treeElement) return;if(!treeElement.isEditing()&&WebInspector.KeyboardShortcut.hasNoModifiers(keyboardEvent)&&keyboardEvent.keyCode===WebInspector.KeyboardShortcut.Keys.H.code){this._toggleHideShortcut(node);event.consume(true);return;}},_contextMenuEventFired:function(event) {var treeElement=this._treeElementFromEvent(event);if(!(treeElement instanceof WebInspector.ElementsTreeElement)||WebInspector.isEditing()) return;var contextMenu=new WebInspector.ContextMenu(event);var isPseudoElement=!!treeElement.node().pseudoType();var isTag=treeElement.node().nodeType()===Node.ELEMENT_NODE&&!isPseudoElement;var textNode=event.target.enclosingNodeOrSelfWithClass("webkit-html-text-node");if(textNode&&textNode.classList.contains("bogus")) textNode=null;var commentNode=event.target.enclosingNodeOrSelfWithClass("webkit-html-comment");contextMenu.appendApplicableItems(event.target);if(textNode){contextMenu.appendSeparator();treeElement.populateTextContextMenu(contextMenu,textNode);}else if(isTag){contextMenu.appendSeparator();treeElement.populateTagContextMenu(contextMenu,event);}else if(commentNode){contextMenu.appendSeparator();treeElement.populateNodeContextMenu(contextMenu);}else if(isPseudoElement){treeElement.populateScrollIntoView(contextMenu);} contextMenu.appendApplicableItems(treeElement.node());contextMenu.show();},runPendingUpdates:function() {this._updateModifiedNodes();},handleShortcut:function(event) {var node=this.selectedDOMNode();if(!node) return;var treeElement=node[this._treeElementSymbol];if(!treeElement) return;if(event.keyIdentifier==="F2"&&treeElement.hasEditableNode()){this._toggleEditAsHTML(node);event.handled=true;return;} if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&node.parentNode){if(event.keyIdentifier==="Up"&&node.previousSibling){node.moveTo(node.parentNode,node.previousSibling,this.selectNodeAfterEdit.bind(this,treeElement.expanded));event.handled=true;return;} if(event.keyIdentifier==="Down"&&node.nextSibling){node.moveTo(node.parentNode,node.nextSibling.nextSibling,this.selectNodeAfterEdit.bind(this,treeElement.expanded));event.handled=true;return;}}},_toggleEditAsHTML:function(node) {var treeElement=node[this._treeElementSymbol];if(!treeElement) return;if(node.pseudoType()) return;var parentNode=node.parentNode;var index=node.index;var wasExpanded=treeElement.expanded;treeElement.toggleEditAsHTML(editingFinished.bind(this));function editingFinished(success) {if(!success) return;this.runPendingUpdates();var newNode=parentNode?parentNode.children()[index]||parentNode:null;if(!newNode) return;this.selectDOMNode(newNode,true);if(wasExpanded){var newTreeItem=this.findTreeElement(newNode);if(newTreeItem) newTreeItem.expand();}}},selectNodeAfterEdit:function(wasExpanded,error,nodeId) {if(error) return null;this.runPendingUpdates();var newNode=nodeId?this._domModel.nodeForId(nodeId):null;if(!newNode) return null;this.selectDOMNode(newNode,true);var newTreeItem=this.findTreeElement(newNode);if(wasExpanded){if(newTreeItem) newTreeItem.expand();} return newTreeItem;},_toggleHideShortcut:function(node,userCallback) {var pseudoType=node.pseudoType();var effectiveNode=pseudoType?node.parentNode:node;if(!effectiveNode) return;function resolvedNode(object) {if(!object) return;function toggleClassAndInjectStyleRule(pseudoType) {const classNamePrefix="__web-inspector-hide";const classNameSuffix="-shortcut__";const styleTagId="__web-inspector-hide-shortcut-style__";var selectors=[];selectors.push(".__web-inspector-hide-shortcut__");selectors.push(".__web-inspector-hide-shortcut__ *");selectors.push(".__web-inspector-hidebefore-shortcut__::before");selectors.push(".__web-inspector-hideafter-shortcut__::after");var selector=selectors.join(", ");var ruleBody=" visibility: hidden !important;";var rule="\n"+selector+"\n{\n"+ruleBody+"\n}\n";var className=classNamePrefix+(pseudoType||"")+classNameSuffix;this.classList.toggle(className);var localRoot=this;while(localRoot.parentNode) localRoot=localRoot.parentNode;if(localRoot.nodeType===Node.DOCUMENT_NODE) localRoot=document.head;var style=localRoot.querySelector("style#"+styleTagId);if(style) return;style=document.createElement("style");style.id=styleTagId;style.type="text/css";style.textContent=rule;localRoot.appendChild(style);} object.callFunction(toggleClassAndInjectStyleRule,[{value:pseudoType}],userCallback);object.release();} effectiveNode.resolveToObject("",resolvedNode);},_reset:function() {this.rootDOMNode=null;this.selectDOMNode(null,false);this._popoverHelper.hidePopover();delete this._clipboardNodeData;WebInspector.DOMModel.hideDOMNodeHighlight();this._updateRecords.clear();},wireToDOMModel:function() {this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeInserted,this._nodeInserted,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeRemoved,this._nodeRemoved,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrModified,this._attributeModified,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrRemoved,this._attributeRemoved,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.CharacterDataModified,this._characterDataModified,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.DocumentUpdated,this._documentUpdated,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.ChildNodeCountUpdated,this._childNodeCountUpdated,this);this._domModel.addEventListener(WebInspector.DOMModel.Events.DistributedNodesChanged,this._distributedNodesChanged,this);},unwireFromDOMModel:function() {this._domModel.removeEventListener(WebInspector.DOMModel.Events.NodeInserted,this._nodeInserted,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.NodeRemoved,this._nodeRemoved,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.AttrModified,this._attributeModified,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.AttrRemoved,this._attributeRemoved,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.CharacterDataModified,this._characterDataModified,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.DocumentUpdated,this._documentUpdated,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.ChildNodeCountUpdated,this._childNodeCountUpdated,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.DistributedNodesChanged,this._distributedNodesChanged,this);},_addUpdateRecord:function(node) {var record=this._updateRecords.get(node);if(!record){record=new WebInspector.ElementsTreeOutline.UpdateRecord();this._updateRecords.set(node,record);} return record;},_updateRecordForHighlight:function(node) {if(!WebInspector.moduleSetting("highlightDOMUpdates").get()||!this._visible) return null;return this._updateRecords.get(node)||null;},_documentUpdated:function(event) {var inspectedRootDocument=event.data;this._reset();if(!inspectedRootDocument) return;this.rootDOMNode=inspectedRootDocument;},_attributeModified:function(event) {var node=(event.data.node);this._addUpdateRecord(node).attributeModified(event.data.name);this._updateModifiedNodesSoon();},_attributeRemoved:function(event) {var node=(event.data.node);this._addUpdateRecord(node).attributeRemoved(event.data.name);this._updateModifiedNodesSoon();},_characterDataModified:function(event) {var node=(event.data);this._addUpdateRecord(node).charDataModified();this._updateModifiedNodesSoon();},_nodeInserted:function(event) {var node=(event.data);this._addUpdateRecord((node.parentNode)).nodeInserted(node);this._updateModifiedNodesSoon();},_nodeRemoved:function(event) {var node=(event.data.node);var parentNode=(event.data.parent);this.resetClipboardIfNeeded(node);this._addUpdateRecord(parentNode).nodeRemoved(node);this._updateModifiedNodesSoon();},_childNodeCountUpdated:function(event) {var node=(event.data);this._addUpdateRecord(node).childrenModified();this._updateModifiedNodesSoon();},_distributedNodesChanged:function(event) {var node=(event.data);this._addUpdateRecord(node).childrenModified();this._updateModifiedNodesSoon();},_updateModifiedNodesSoon:function() {if(!this._updateRecords.size) return;if(this._updateModifiedNodesTimeout) return;this._updateModifiedNodesTimeout=setTimeout(this._updateModifiedNodes.bind(this),50);},_updateModifiedNodes:function() {if(this._updateModifiedNodesTimeout){clearTimeout(this._updateModifiedNodesTimeout);delete this._updateModifiedNodesTimeout;} var updatedNodes=this._updateRecords.keysArray();var hidePanelWhileUpdating=updatedNodes.length>10;if(hidePanelWhileUpdating){var treeOutlineContainerElement=this.element.parentNode;var originalScrollTop=treeOutlineContainerElement?treeOutlineContainerElement.scrollTop:0;this._element.classList.add("hidden");} if(this._rootDOMNode&&this._updateRecords.get(this._rootDOMNode)&&this._updateRecords.get(this._rootDOMNode).hasChangedChildren()){this.update();}else{for(var node of this._updateRecords.keys()){if(this._updateRecords.get(node).hasChangedChildren()) this._updateModifiedParentNode(node);else this._updateModifiedNode(node);}} if(hidePanelWhileUpdating){this._element.classList.remove("hidden");if(originalScrollTop) treeOutlineContainerElement.scrollTop=originalScrollTop;this.updateSelection();} this._updateRecords.clear();this._fireElementsTreeUpdated(updatedNodes);},_updateModifiedNode:function(node) {var treeElement=this.findTreeElement(node);if(treeElement) treeElement.updateTitle(this._updateRecordForHighlight(node));},_updateModifiedParentNode:function(node) {var parentTreeElement=this.findTreeElement(node);if(parentTreeElement){parentTreeElement.setExpandable(this._hasVisibleChildren(node));parentTreeElement.updateTitle(this._updateRecordForHighlight(node));if(parentTreeElement.populated) this._updateChildren(parentTreeElement);}},populateTreeElement:function(treeElement) {if(treeElement.childCount()||!treeElement.isExpandable()) return;this._updateModifiedParentNode(treeElement.node());},_createElementTreeElement:function(node,closingTag) {var treeElement=new WebInspector.ElementsTreeElement(node,closingTag);treeElement.setExpandable(!closingTag&&this._hasVisibleChildren(node));treeElement.selectable=this._selectEnabled;return treeElement;},_showChild:function(treeElement,child) {if(treeElement.isClosingTag()) return null;var index=this._visibleChildren(treeElement.node()).indexOf(child);if(index===-1) return null;if(index>=treeElement.expandedChildrenLimit()) this.setExpandedChildrenLimit(treeElement,index+1);return(treeElement.childAt(index));},_visibleChildren:function(node) {var visibleChildren=WebInspector.ElementsTreeElement.visibleShadowRoots(node);if(node.importedDocument()) visibleChildren.push(node.importedDocument());if(node.templateContent()) visibleChildren.push(node.templateContent());var beforePseudoElement=node.beforePseudoElement();if(beforePseudoElement) visibleChildren.push(beforePseudoElement);if(node.childNodeCount()) visibleChildren=visibleChildren.concat(node.children());var afterPseudoElement=node.afterPseudoElement();if(afterPseudoElement) visibleChildren.push(afterPseudoElement);return visibleChildren;},_hasVisibleChildren:function(node) {if(WebInspector.ElementsTreeElement.canShowInlineText(node)) return false;if(node.importedDocument()) return true;if(node.templateContent()) return true;if(node.childNodeCount()) return true;if(WebInspector.ElementsTreeElement.visibleShadowRoots(node).length) return true;if(node.hasPseudoElements()) return true;if(node.isInsertionPoint()) return true;return false;},_createExpandAllButtonTreeElement:function(treeElement) {var button=createTextButton("",handleLoadAllChildren.bind(this));button.value="";var expandAllButtonElement=new TreeElement(button);expandAllButtonElement.selectable=false;expandAllButtonElement.expandAllButton=true;expandAllButtonElement.button=button;return expandAllButtonElement;function handleLoadAllChildren(event) {var visibleChildCount=this._visibleChildren(treeElement.node()).length;this.setExpandedChildrenLimit(treeElement,Math.max(visibleChildCount,treeElement.expandedChildrenLimit()+WebInspector.ElementsTreeElement.InitialChildrenLimit));event.consume();}},setExpandedChildrenLimit:function(treeElement,expandedChildrenLimit) {if(treeElement.expandedChildrenLimit()===expandedChildrenLimit) return;treeElement.setExpandedChildrenLimit(expandedChildrenLimit);if(treeElement.treeOutline&&!this._treeElementsBeingUpdated.has(treeElement)) this._updateModifiedParentNode(treeElement.node());},_updateChildren:function(treeElement) {if(!treeElement.isExpandable()){var selectedTreeElement=treeElement.treeOutline.selectedTreeElement;if(selectedTreeElement&&selectedTreeElement.hasAncestor(treeElement)) treeElement.select(true);treeElement.removeChildren();return;} console.assert(!treeElement.isClosingTag());treeElement.node().getChildNodes(childNodesLoaded.bind(this));function childNodesLoaded(children) {if(!children) return;this._innerUpdateChildren(treeElement);}},insertChildElement:function(treeElement,child,index,closingTag) {var newElement=this._createElementTreeElement(child,closingTag);treeElement.insertChild(newElement,index);return newElement;},_moveChild:function(treeElement,child,targetIndex) {if(treeElement.indexOfChild(child)===targetIndex) return;var wasSelected=child.selected;if(child.parent) child.parent.removeChild(child);treeElement.insertChild(child,targetIndex);if(wasSelected) child.select();},_innerUpdateChildren:function(treeElement) {if(this._treeElementsBeingUpdated.has(treeElement)) return;this._treeElementsBeingUpdated.add(treeElement);var node=treeElement.node();var visibleChildren=this._visibleChildren(node);var visibleChildrenSet=new Set(visibleChildren);var existingTreeElements=new Map();for(var i=treeElement.childCount()-1;i>=0;--i){var existingTreeElement=treeElement.childAt(i);if(!(existingTreeElement instanceof WebInspector.ElementsTreeElement)){treeElement.removeChildAtIndex(i);continue;} var elementsTreeElement=(existingTreeElement);var existingNode=elementsTreeElement.node();if(visibleChildrenSet.has(existingNode)){existingTreeElements.set(existingNode,existingTreeElement);continue;} treeElement.removeChildAtIndex(i);} for(var i=0;itreeElement.expandedChildrenLimit()) this.setExpandedChildrenLimit(treeElement,treeElement.expandedChildrenLimit()+1);}} var expandedChildCount=treeElement.childCount();if(visibleChildren.length>expandedChildCount){var targetButtonIndex=expandedChildCount;if(!treeElement.expandAllButtonElement) treeElement.expandAllButtonElement=this._createExpandAllButtonTreeElement(treeElement);treeElement.insertChild(treeElement.expandAllButtonElement,targetButtonIndex);treeElement.expandAllButtonElement.button.textContent=WebInspector.UIString("Show All Nodes (%d More)",visibleChildren.length-expandedChildCount);}else if(treeElement.expandAllButtonElement){delete treeElement.expandAllButtonElement;} if(node.isInsertionPoint()){for(var distributedNode of node.distributedNodes()) treeElement.appendChild(new WebInspector.ElementsTreeOutline.ShortcutTreeElement(distributedNode));} if(node.nodeType()===Node.ELEMENT_NODE&&treeElement.isExpandable()) this.insertChildElement(treeElement,node,treeElement.childCount(),true);this._treeElementsBeingUpdated.delete(treeElement);},__proto__:TreeOutline.prototype} WebInspector.ElementsTreeOutline.ElementDecorator=function() {} WebInspector.ElementsTreeOutline.ElementDecorator.prototype={decorate:function(node) {},decorateAncestor:function(node) {}} WebInspector.ElementsTreeOutline.PseudoStateDecorator=function() {WebInspector.ElementsTreeOutline.ElementDecorator.call(this);} WebInspector.ElementsTreeOutline.PseudoStateDecorator.prototype={decorate:function(node) {if(node.nodeType()!==Node.ELEMENT_NODE) return null;var propertyValue=node.getUserProperty(WebInspector.CSSStyleModel.PseudoStatePropertyName);if(!propertyValue) return null;return WebInspector.UIString("Element state: %s",":"+propertyValue.join(", :"));},decorateAncestor:function(node) {if(node.nodeType()!==Node.ELEMENT_NODE) return null;var descendantCount=node.descendantUserPropertyCount(WebInspector.CSSStyleModel.PseudoStatePropertyName);if(!descendantCount) return null;if(descendantCount===1) return WebInspector.UIString("%d descendant with forced state",descendantCount);return WebInspector.UIString("%d descendants with forced state",descendantCount);}} WebInspector.ElementsTreeOutline.UpdateRecord=function() {} WebInspector.ElementsTreeOutline.UpdateRecord.prototype={attributeModified:function(attrName) {if(this._removedAttributes&&this._removedAttributes.has(attrName)) this._removedAttributes.delete(attrName);if(!this._modifiedAttributes) this._modifiedAttributes=(new Set());this._modifiedAttributes.add(attrName);},attributeRemoved:function(attrName) {if(this._modifiedAttributes&&this._modifiedAttributes.has(attrName)) this._modifiedAttributes.delete(attrName);if(!this._removedAttributes) this._removedAttributes=(new Set());this._removedAttributes.add(attrName);},nodeInserted:function(node) {this._hasChangedChildren=true;},nodeRemoved:function(node) {this._hasChangedChildren=true;this._hasRemovedChildren=true;},charDataModified:function() {this._charDataModified=true;},childrenModified:function() {this._hasChangedChildren=true;},isAttributeModified:function(attributeName) {return this._modifiedAttributes&&this._modifiedAttributes.has(attributeName);},hasRemovedAttributes:function() {return!!this._removedAttributes&&!!this._removedAttributes.size;},isCharDataModified:function() {return!!this._charDataModified;},hasChangedChildren:function() {return!!this._hasChangedChildren;},hasRemovedChildren:function() {return!!this._hasRemovedChildren;}} WebInspector.ElementsTreeOutline.Renderer=function() {} WebInspector.ElementsTreeOutline.Renderer.prototype={render:function(object) {return new Promise(renderPromise);function renderPromise(resolve,reject) {if(object instanceof WebInspector.DOMNode){onNodeResolved((object));}else if(object instanceof WebInspector.DeferredDOMNode){((object)).resolve(onNodeResolved);}else if(object instanceof WebInspector.RemoteObject){var domModel=WebInspector.DOMModel.fromTarget(((object)).target());if(domModel) domModel.pushObjectAsNodeToFrontend(object,onNodeResolved);else reject(new Error("No dom model for given JS object target found."));}else{reject(new Error("Can't reveal not a node."));} function onNodeResolved(node) {if(!node){reject(new Error("Could not resolve node."));return;} var treeOutline=new WebInspector.ElementsTreeOutline(node.domModel(),false,false);treeOutline.rootDOMNode=node;if(!treeOutline.firstChild().isExpandable()) treeOutline._element.classList.add("single-node");treeOutline.setVisible(true);treeOutline.element.treeElementForTest=treeOutline.firstChild();resolve(treeOutline.element);}}}} WebInspector.ElementsTreeOutline.ShortcutTreeElement=function(nodeShortcut) {TreeElement.call(this,"");this.listItemElement.createChild("div","selection");var title=this.listItemElement.createChild("span","elements-tree-shortcut-title");var text=nodeShortcut.nodeName.toLowerCase();if(nodeShortcut.nodeType===Node.ELEMENT_NODE) text="<"+text+">";title.textContent="\u21AA "+text;var link=WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference(nodeShortcut.deferredNode);this.listItemElement.createTextChild(" ");link.classList.add("elements-tree-shortcut-link");link.textContent=WebInspector.UIString("reveal");this.listItemElement.appendChild(link);this._nodeShortcut=nodeShortcut;} WebInspector.ElementsTreeOutline.ShortcutTreeElement.prototype={get hovered() {return this._hovered;},set hovered(x) {if(this._hovered===x) return;this._hovered=x;this.listItemElement.classList.toggle("hovered",x);},updateSelection:function() {},backendNodeId:function() {return this._nodeShortcut.deferredNode.backendNodeId();},onselect:function(selectedByUser) {if(!selectedByUser) return true;this._nodeShortcut.deferredNode.highlight();this._nodeShortcut.deferredNode.resolve(resolved.bind(this));function resolved(node) {if(node){this.treeOutline._selectedDOMNode=node;this.treeOutline._selectedNodeChanged();}} return true;},__proto__:TreeElement.prototype};WebInspector.SharedSidebarModel=function() {WebInspector.Object.call(this);this._node=WebInspector.context.flavor(WebInspector.DOMNode);WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode,this._onNodeChanged,this);} WebInspector.SharedSidebarModel.elementNode=function(node) {if(node&&node.nodeType()===Node.TEXT_NODE&&node.parentNode) node=node.parentNode;if(node&&node.nodeType()!==Node.ELEMENT_NODE) node=null;return node;} WebInspector.SharedSidebarModel.Events={ComputedStyleChanged:"ComputedStyleChanged"} WebInspector.SharedSidebarModel.prototype={node:function() {return this._node;},cssModel:function() {return this._cssModel;},_onNodeChanged:function(event) {this._node=(event.data);this._updateTarget(this._node?this._node.target():null);this._onComputedStyleChanged();},_updateTarget:function(target) {if(this._target===target) return;if(this._target){this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._onComputedStyleChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._onComputedStyleChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._onComputedStyleChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this._onComputedStyleChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.PseudoStateForced,this._onComputedStyleChanged,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this._onComputedStyleChanged,this);this._domModel.removeEventListener(WebInspector.DOMModel.Events.DOMMutated,this._onComputedStyleChanged,this);} this._target=target;if(target){this._cssModel=WebInspector.CSSStyleModel.fromTarget(target);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._onComputedStyleChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._onComputedStyleChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._onComputedStyleChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this._onComputedStyleChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.PseudoStateForced,this._onComputedStyleChanged,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this._onComputedStyleChanged,this);this._domModel=WebInspector.DOMModel.fromTarget(target);this._domModel.addEventListener(WebInspector.DOMModel.Events.DOMMutated,this._onComputedStyleChanged,this);}},_elementNode:function() {return WebInspector.SharedSidebarModel.elementNode(this.node());},fetchComputedStyle:function() {var elementNode=this._elementNode();var cssModel=this.cssModel();if(!elementNode||!cssModel) return Promise.resolve((null));if(!this._computedStylePromise) this._computedStylePromise=cssModel.computedStylePromise(elementNode.id).then(verifyOutdated.bind(this,elementNode));return this._computedStylePromise;function verifyOutdated(elementNode,style) {return elementNode===this._elementNode()&&style?new WebInspector.SharedSidebarModel.ComputedStyle(elementNode,style):(null);}},_onComputedStyleChanged:function() {delete this._computedStylePromise;this.dispatchEventToListeners(WebInspector.SharedSidebarModel.Events.ComputedStyleChanged);},__proto__:WebInspector.Object.prototype} WebInspector.SharedSidebarModel.ComputedStyle=function(node,computedStyle) {this.node=node;this.computedStyle=computedStyle;};WebInspector.EventListenersWidget=function() {WebInspector.ThrottledWidget.call(this);this.element.classList.add("events-pane");this._showForAncestorsSetting=WebInspector.settings.createSetting("showEventListenersForAncestors",true);this._showForAncestorsSetting.addChangeListener(this.update.bind(this));this._eventListenersView=new WebInspector.EventListenersView(this.element);WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode,this.update,this);} WebInspector.EventListenersWidget.createSidebarWrapper=function() {var widget=new WebInspector.EventListenersWidget();var result=new WebInspector.ElementsSidebarViewWrapperPane(WebInspector.UIString("Event Listeners"),widget);var refreshButton=new WebInspector.ToolbarButton(WebInspector.UIString("Refresh"),"refresh-toolbar-item");refreshButton.addEventListener("click",widget.update.bind(widget));result.toolbar().appendToolbarItem(refreshButton);result.toolbar().appendToolbarItem(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Ancestors"),WebInspector.UIString("Show listeners on the ancestors"),widget._showForAncestorsSetting));return result;} WebInspector.EventListenersWidget._objectGroupName="event-listeners-panel";WebInspector.EventListenersWidget.prototype={doUpdate:function(finishCallback) {if(this._lastRequestedNode){this._lastRequestedNode.target().runtimeAgent().releaseObjectGroup(WebInspector.EventListenersWidget._objectGroupName);delete this._lastRequestedNode;} var node=WebInspector.context.flavor(WebInspector.DOMNode);if(!node){this._eventListenersView.reset();this._eventListenersView.addEmptyHolderIfNeeded();finishCallback();return;} this._lastRequestedNode=node;var selectedNodeOnly=!this._showForAncestorsSetting.get();var promises=[];var listenersView=this._eventListenersView;promises.push(node.resolveToObjectPromise(WebInspector.EventListenersWidget._objectGroupName));if(!selectedNodeOnly){var currentNode=node.parentNode;while(currentNode){promises.push(currentNode.resolveToObjectPromise(WebInspector.EventListenersWidget._objectGroupName));currentNode=currentNode.parentNode;} promises.push(this._windowObjectInNodeContext(node));} Promise.all(promises).then(this._eventListenersView.addObjects.bind(this._eventListenersView)).then(finishCallback.bind(this,undefined));},_windowObjectInNodeContext:function(node) {return new Promise(windowObjectInNodeContext);function windowObjectInNodeContext(fulfill,reject) {var executionContexts=node.target().runtimeModel.executionContexts();var context=null;if(node.frameId()){for(var i=0;i0&&this.mediaMatches():true;},mediaMatches:function() {var media=this.media();for(var i=0;media&&i0) return;var usedProperties=WebInspector.SectionCascade._computeUsedProperties(this._models,this._allUsedProperties);for(var i=0;i=0;--j){var rule=pseudoElementCSSRules.rules[j];pseudoElementCascade.appendModelFromRule(rule);} pseudoCascades.set(pseudoId,pseudoElementCascade);} return pseudoCascades;},_nodeStylesUpdatedForTest:function(node,rebuild) {},_buildMatchedRulesSectionCascade:function(node,styles) {var cascade=new WebInspector.SectionCascade();function addAttributesStyle() {if(!styles.attributesStyle) return;var selectorText=node.nodeNameInCorrectCase()+"["+WebInspector.UIString("Attributes Style")+"]";cascade.appendModelFromStyle(styles.attributesStyle,selectorText);} if(styles.inlineStyle&&node.nodeType()===Node.ELEMENT_NODE){var model=cascade.appendModelFromStyle(styles.inlineStyle,"element.style");model.setIsAttribute(true);} var addedAttributesStyle;for(var i=styles.matchedCSSRules.length-1;i>=0;--i){var rule=styles.matchedCSSRules[i];if((rule.isInjected||rule.isUserAgent)&&!addedAttributesStyle){addedAttributesStyle=true;addAttributesStyle();} cascade.appendModelFromRule(rule);} if(!addedAttributesStyle) addAttributesStyle();var parentNode=node.parentNode;for(var parentOrdinal=0;parentOrdinal=0;--i){var rulePayload=parentStyles.matchedCSSRules[i];if(!this._containsInherited(rulePayload.style)) continue;cascade.appendModelFromRule(rulePayload,parentNode);} parentNode=parentNode.parentNode;} return cascade;},_appendTopPadding:function() {var separatorElement=createElement("div");separatorElement.className="styles-sidebar-placeholder";this._sectionsContainer.appendChild(separatorElement);},_rebuildSectionsForMatchedStyleRules:function(matchedCascade) {var blocks=[new WebInspector.SectionBlock(null)];var lastParentNode=null;for(var sectionModel of matchedCascade.sectionModels()){var parentNode=sectionModel.parentNode();if(parentNode&&parentNode!==lastParentNode){lastParentNode=parentNode;var block=WebInspector.SectionBlock.createInheritedNodeBlock(lastParentNode);blocks.push(block);} var section=new WebInspector.StylePropertiesSection(this,sectionModel);blocks.peekLast().sections.push(section);} return blocks;},_containsInherited:function(style) {var properties=style.allProperties;for(var i=0;i=0;--i){var media=mediaRules[i];var mediaDataElement=this._mediaListElement.createChild("div","media");if(media.sourceURL){var anchor=this._parentPane._linkifier.linkifyMedia(media);anchor.classList.add("subtitle");mediaDataElement.appendChild(anchor);} var mediaContainerElement=mediaDataElement.createChild("span");var mediaTextElement=mediaContainerElement.createChild("span","media-text");mediaTextElement.title=media.text;switch(media.source){case WebInspector.CSSMedia.Source.LINKED_SHEET:case WebInspector.CSSMedia.Source.INLINE_SHEET:mediaTextElement.textContent="media=\""+media.text+"\"";break;case WebInspector.CSSMedia.Source.MEDIA_RULE:var decoration=mediaContainerElement.createChild("span");mediaContainerElement.insertBefore(decoration,mediaTextElement);decoration.textContent="@media ";decoration.title=media.text;mediaTextElement.textContent=media.text;if(media.parentStyleSheetId){mediaDataElement.classList.add("editable-media");mediaTextElement.addEventListener("click",this._handleMediaRuleClick.bind(this,media,mediaTextElement),false);} break;case WebInspector.CSSMedia.Source.IMPORT_RULE:mediaTextElement.textContent="@import "+media.text;break;}}},_updateMediaList:function() {this._mediaListElement.removeChildren();this._createMediaList(this.styleRule.media());},isPropertyInherited:function(propertyName) {if(this.styleRule.inherited()){return!WebInspector.CSSMetadata.isPropertyInherited(propertyName);} return false;},nextEditableSibling:function() {var curSection=this;do{curSection=curSection.nextSibling();}while(curSection&&!curSection.editable);if(!curSection){curSection=this.firstSibling();while(curSection&&!curSection.editable) curSection=curSection.nextSibling();} return(curSection&&curSection.editable)?curSection:null;},previousEditableSibling:function() {var curSection=this;do{curSection=curSection.previousSibling();}while(curSection&&!curSection.editable);if(!curSection){curSection=this.lastSibling();while(curSection&&!curSection.editable) curSection=curSection.previousSibling();} return(curSection&&curSection.editable)?curSection:null;},update:function(full) {if(this.styleRule.selectorText()) this._selectorElement.textContent=this.styleRule.selectorText();this._markSelectorMatches();if(full){this.propertiesTreeOutline.removeChildren();this.onpopulate();}else{var child=this.propertiesTreeOutline.firstChild();while(child){child.setOverloaded(this.styleRule.isPropertyOverloaded(child.name,child.isShorthand));child=child.traverseNextTreeElement(false,null,true);}} this.afterUpdate();},afterUpdate:function() {if(this._afterUpdate){this._afterUpdate(this);delete this._afterUpdate;this._afterUpdateFinishedForTest();}},_afterUpdateFinishedForTest:function() {},onpopulate:function() {var style=this.styleRule.style();var allProperties=style.allProperties;var styleHasEditableSource=this.editable&&!!style.range;if(styleHasEditableSource){for(var i=0;i0;this.element.classList.toggle("no-affect",!doesAffectSelectedNode);var oldSelectorRange=this.rule().selectorRange;this.styleRule.updateRule(newRule);this._parentPane._refreshUpdate(this);this._parentPane._styleSheetRuleEdited(newRule,oldSelectorRange,newRule.selectorRange);} delete this._parentPane._userOperation;this._moveEditorFromSelector(moveDirection);this._editingSelectorCommittedForTest();} this._parentPane._userOperation=true;var selectedNode=this._parentPane.node();this._parentPane._cssModel.setRuleSelector(this.rule(),selectedNode?selectedNode.id:0,newContent,finishCallback.bind(this));},_editingSelectorCommittedForTest:function(){},_updateRuleOrigin:function() {this._selectorRefElement.removeChildren();this._selectorRefElement.appendChild(WebInspector.StylePropertiesSection.createRuleOriginNode(this._parentPane._cssModel,this._parentPane._linkifier,this.rule()));},_editingSelectorEnded:function() {this._parentPane.setEditingStyle(false);this._parentPane._finishEditingSelector();},editingSelectorCancelled:function() {this._editingSelectorEnded();this._markSelectorMatches();}} WebInspector.StylePropertiesSection.createRuleOriginNode=function(cssModel,linkifier,rule) {if(!rule) return createTextNode("");var firstMatchingIndex=rule.matchingSelectors&&rule.matchingSelectors.length?rule.matchingSelectors[0]:0;var ruleLocation=rule.selectors[firstMatchingIndex].range;var header=rule.styleSheetId?cssModel.styleSheetHeaderForId(rule.styleSheetId):null;if(ruleLocation&&rule.styleSheetId&&header&&header.resourceURL()) return WebInspector.StylePropertiesSection._linkifyRuleLocation(cssModel,linkifier,rule.styleSheetId,ruleLocation);if(rule.isUserAgent) return createTextNode(WebInspector.UIString("user agent stylesheet"));if(rule.isInjected) return createTextNode(WebInspector.UIString("injected stylesheet"));if(rule.isViaInspector) return createTextNode(WebInspector.UIString("via inspector"));if(header&&header.ownerNode){var link=WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference(header.ownerNode);link.textContent="";return link;} return createTextNode("");} WebInspector.StylePropertiesSection._linkifyRuleLocation=function(cssModel,linkifier,styleSheetId,ruleLocation) {var styleSheetHeader=cssModel.styleSheetHeaderForId(styleSheetId);var sourceURL=styleSheetHeader.resourceURL();var lineNumber=styleSheetHeader.lineNumberInSource(ruleLocation.startLine);var columnNumber=styleSheetHeader.columnNumberInSource(ruleLocation.startLine,ruleLocation.startColumn);var matchingSelectorLocation=new WebInspector.CSSLocation(cssModel,styleSheetId,sourceURL,lineNumber,columnNumber);return linkifier.linkifyCSSLocation(matchingSelectorLocation);} WebInspector.BlankStylePropertiesSection=function(stylesPane,defaultSelectorText,styleSheetId,ruleLocation,insertAfterStyleRule) {var dummyCascade=new WebInspector.SectionCascade();var blankSectionModel=dummyCascade.appendModelFromStyle(WebInspector.CSSStyleDeclaration.createDummyStyle(stylesPane._cssModel),defaultSelectorText);blankSectionModel.setEditable(true);WebInspector.StylePropertiesSection.call(this,stylesPane,blankSectionModel);this._ruleLocation=ruleLocation;this._styleSheetId=styleSheetId;this._selectorRefElement.removeChildren();this._selectorRefElement.appendChild(WebInspector.StylePropertiesSection._linkifyRuleLocation(this._parentPane._cssModel,this._parentPane._linkifier,styleSheetId,this._actualRuleLocation()));if(insertAfterStyleRule) this._createMediaList(insertAfterStyleRule.media());this._insertAfterStyleRule=insertAfterStyleRule;this.element.classList.add("blank-section");} WebInspector.BlankStylePropertiesSection.prototype={_actualRuleLocation:function() {var prefix=this._rulePrefix();var lines=prefix.split("\n");var editRange=new WebInspector.TextRange(0,0,lines.length-1,lines.peekLast().length);return this._ruleLocation.rebaseAfterTextEdit(WebInspector.TextRange.createFromLocation(0,0),editRange);},_rulePrefix:function() {return this._ruleLocation.startLine===0&&this._ruleLocation.startColumn===0?"":"\n\n";},get isBlank() {return!this._normal;},editingSelectorCommitted:function(element,newContent,oldContent,context,moveDirection) {if(!this.isBlank){WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.call(this,element,newContent,oldContent,context,moveDirection);return;} function userCallback(newRule) {if(!newRule){this.editingSelectorCancelled();this._editingSelectorCommittedForTest();return;} var doesSelectorAffectSelectedNode=newRule.matchingSelectors.length>0;this._makeNormal(newRule);if(!doesSelectorAffectSelectedNode) this.element.classList.add("no-affect");var ruleTextLines=ruleText.split("\n");var startLine=this._ruleLocation.startLine;var startColumn=this._ruleLocation.startColumn;var newRange=new WebInspector.TextRange(startLine,startColumn,startLine+ruleTextLines.length-1,startColumn+ruleTextLines[ruleTextLines.length-1].length);this._parentPane._styleSheetRuleEdited(newRule,this._ruleLocation,newRange);this._updateRuleOrigin();if(this.element.parentElement) this._moveEditorFromSelector(moveDirection);delete this._parentPane._userOperation;this._editingSelectorEnded();this._markSelectorMatches();this._editingSelectorCommittedForTest();} if(newContent) newContent=newContent.trim();this._parentPane._userOperation=true;var cssModel=this._parentPane._cssModel;var ruleText=this._rulePrefix()+newContent+" {}";cssModel.addRule(this._styleSheetId,this._parentPane.node(),ruleText,this._ruleLocation,userCallback.bind(this));},editingSelectorCancelled:function() {delete this._parentPane._userOperation;if(!this.isBlank){WebInspector.StylePropertiesSection.prototype.editingSelectorCancelled.call(this);return;} this._editingSelectorEnded();this._parentPane.removeSection(this);},_makeNormal:function(newRule) {this.element.classList.remove("blank-section");var model=this._insertAfterStyleRule.cascade().insertModelFromRule(newRule,this._insertAfterStyleRule);this.styleRule=model;this._normal=true;},__proto__:WebInspector.StylePropertiesSection.prototype} WebInspector.StylePropertyTreeElement=function(stylesPane,styleRule,property,isShorthand,inherited,overloaded) {TreeElement.call(this,"",isShorthand);this._styleRule=styleRule;this.property=property;this._inherited=inherited;this._overloaded=overloaded;this.selectable=false;this._parentPane=stylesPane;this.isShorthand=isShorthand;this._applyStyleThrottler=new WebInspector.Throttler(0);} WebInspector.StylePropertyTreeElement.Context;WebInspector.StylePropertyTreeElement.prototype={style:function() {return this._styleRule.style();},inherited:function() {return this._inherited;},overloaded:function() {return this._overloaded;},setOverloaded:function(x) {if(x===this._overloaded) return;this._overloaded=x;this._updateState();},get name() {return this.property.name;},get value() {return this.property.value;},_updateFilter:function() {var regex=this._parentPane.filterRegex();var matches=!!regex&&(regex.test(this.property.name)||regex.test(this.property.value));this.listItemElement.classList.toggle("filter-match",matches);this.onpopulate();var hasMatchingChildren=false;for(var i=0;i=rootElement.childCount()&&!this._newProperty) createNewProperty=true;else{var treeElement=moveToIndex>=0?rootElement.childAt(moveToIndex):null;if(treeElement){var elementToEdit=!isEditingName||isPropertySplitPaste?treeElement.nameElement:treeElement.valueElement;if(alreadyNew&&blankInput) elementToEdit=moveDirection==="forward"?treeElement.nameElement:treeElement.valueElement;treeElement.startEditing(elementToEdit);return;}else if(!alreadyNew) moveToSelector=true;}} if(createNewProperty){if(alreadyNew&&!valueChanged&&(isEditingName^(moveDirection==="backward"))) return;section.addNewBlankProperty().startEditing();return;} if(abandonNewProperty){moveTo=this._findSibling(moveDirection);var sectionToEdit=(moveTo||moveDirection==="backward")?section:section.nextEditableSibling();if(sectionToEdit){if(sectionToEdit.rule()) sectionToEdit.startEditingSelector();else sectionToEdit._moveEditorFromSelector(moveDirection);} return;} if(moveToSelector){if(section.rule()) section.startEditingSelector();else section._moveEditorFromSelector(moveDirection);}}},_removePrompt:function() {if(this._prompt){this._prompt.detach();delete this._prompt;}},styleTextAppliedForTest:function(){},applyStyleText:function(styleText,majorChange) {this._applyStyleThrottler.schedule(this._innerApplyStyleText.bind(this,styleText,majorChange));},_innerApplyStyleText:function(styleText,majorChange,finishedCallback) {if(!this.treeOutline){finishedCallback();return;} styleText=styleText.replace(/\s/g," ").trim();if(!styleText.length&&majorChange&&this._newProperty&&!this._propertyHasBeenEditedIncrementally){var section=this.section();this.parent.removeChild(this);section.afterUpdate();return;} var currentNode=this._parentPane.node();this._parentPane._userOperation=true;function callback(newStyle) {delete this._parentPane._userOperation;if(!newStyle){if(majorChange){this._revertStyleUponEditingCanceled();} finishedCallback();this.styleTextAppliedForTest();return;} this._applyNewStyle(newStyle);this._propertyHasBeenEditedIncrementally=true;this.property=newStyle.propertyAt(this.property.index);if(!this._parentPane._isEditingStyle&¤tNode===this.node()) this._updatePane();finishedCallback();this.styleTextAppliedForTest();} if(styleText.length&&!/;\s*$/.test(styleText)) styleText+=";";var overwriteProperty=!this._newProperty||this._propertyHasBeenEditedIncrementally;this.property.setText(styleText,majorChange,overwriteProperty,callback.bind(this));},ondblclick:function() {return true;},isEventWithinDisclosureTriangle:function(event) {return event.target===this._expandElement;},__proto__:TreeElement.prototype} WebInspector.StylesSidebarPane.CSSPropertyPrompt=function(cssCompletions,treeElement,isEditingName) {WebInspector.TextPrompt.call(this,this._buildPropertyCompletions.bind(this),WebInspector.StyleValueDelimiters);this.setSuggestBoxEnabled(true);this._cssCompletions=cssCompletions;this._treeElement=treeElement;this._isEditingName=isEditingName;if(!isEditingName) this.disableDefaultSuggestionForEmptyInput();} WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype={onKeyDown:function(event) {switch(event.keyIdentifier){case"Up":case"Down":case"PageUp":case"PageDown":if(this._handleNameOrValueUpDown(event)){event.preventDefault();return;} break;case"Enter":if(this.autoCompleteElement&&!this.autoCompleteElement.textContent.length){this.tabKeyPressed();return;} break;} WebInspector.TextPrompt.prototype.onKeyDown.call(this,event);},onMouseWheel:function(event) {if(this._handleNameOrValueUpDown(event)){event.consume(true);return;} WebInspector.TextPrompt.prototype.onMouseWheel.call(this,event);},tabKeyPressed:function() {this.acceptAutoComplete();return false;},_handleNameOrValueUpDown:function(event) {function finishHandler(originalValue,replacementString) {this._treeElement.applyStyleText(this._treeElement.nameElement.textContent+": "+this._treeElement.valueElement.textContent,false);} function customNumberHandler(prefix,number,suffix) {if(number!==0&&!suffix.length&&WebInspector.CSSMetadata.isLengthProperty(this._treeElement.property.name)) suffix="px";return prefix+number+suffix;} if(!this._isEditingName&&WebInspector.handleElementValueModifications(event,this._treeElement.valueElement,finishHandler.bind(this),this._isValueSuggestion.bind(this),customNumberHandler.bind(this))) return true;return false;},_isValueSuggestion:function(word) {if(!word) 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);if(!this._isEditingName&&!results.length&&prefix.length>1&&"!important".startsWith(prefix)) results.push("!important");var userEnteredText=wordRange.toString().replace("-","");if(userEnteredText&&(userEnteredText===userEnteredText.toUpperCase())){for(var i=0;i=0;}},__proto__:WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype} WebInspector.ElementStatePaneWidget.ButtonProvider=function() {this._button=new WebInspector.ToolbarButton(WebInspector.UIString("Toggle Element State"),"pin-toolbar-item");this._button.addEventListener("click",this._clicked,this);this._view=new WebInspector.ElementStatePaneWidget(this.item());WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode,this._nodeChanged,this);this._nodeChanged();} WebInspector.ElementStatePaneWidget.ButtonProvider.prototype={_clicked:function() {var stylesSidebarPane=WebInspector.ElementsPanel.instance().sidebarPanes.styles;stylesSidebarPane.showToolbarPane(!this._view.isShowing()?this._view:null);},item:function() {return this._button;},_nodeChanged:function() {var enabled=!!WebInspector.context.flavor(WebInspector.DOMNode);this._button.setEnabled(enabled);if(!enabled&&this._button.toggled()) WebInspector.ElementsPanel.instance().sidebarPanes.styles.showToolbarPane(null);}};WebInspector.ElementsPanel=function() {WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("elements/elementsPanel.css");this._splitWidget=new WebInspector.SplitWidget(true,true,"elementsPanelSplitViewState",325,325);this._splitWidget.addEventListener(WebInspector.SplitWidget.Events.SidebarSizeChanged,this._updateTreeOutlineVisibleWidth.bind(this));this._splitWidget.show(this.element);this._searchableView=new WebInspector.SearchableView(this);this._searchableView.setMinimumSize(25,19);this._searchableView.setPlaceholder(WebInspector.UIString("Find by string, selector, or XPath"));var stackElement=this._searchableView.element;this._contentElement=createElement("div");var crumbsContainer=createElement("div");if(Runtime.experiments.isEnabled("materialDesign")){this._toolbar=this._createElementsToolbar();var toolbar=stackElement.createChild("div","elements-topbar hbox");toolbar.appendChild(crumbsContainer);toolbar.appendChild(this._toolbar.element);stackElement.appendChild(this._contentElement);}else{stackElement.appendChild(this._contentElement);stackElement.appendChild(crumbsContainer);} this._elementsPanelTreeOutilneSplit=new WebInspector.SplitWidget(false,true,"treeOutlineAnimationTimelineWidget",300,300);this._elementsPanelTreeOutilneSplit.hideSidebar();this._elementsPanelTreeOutilneSplit.setMainWidget(this._searchableView);this._splitWidget.setMainWidget(this._elementsPanelTreeOutilneSplit);this._contentElement.id="elements-content";if(WebInspector.moduleSetting("domWordWrap").get()) this._contentElement.classList.add("elements-wrap");WebInspector.moduleSetting("domWordWrap").addChangeListener(this._domWordWrapSettingChanged.bind(this));crumbsContainer.id="elements-crumbs";this._breadcrumbs=new WebInspector.ElementsBreadcrumbs();this._breadcrumbs.show(crumbsContainer);this._breadcrumbs.addEventListener(WebInspector.ElementsBreadcrumbs.Events.NodeSelected,this._crumbNodeSelected,this);this.sidebarPanes={};this._elementsSidebarViewWrappers=[];var sharedSidebarModel=new WebInspector.SharedSidebarModel();this.sidebarPanes.platformFonts=WebInspector.PlatformFontsWidget.createSidebarWrapper(sharedSidebarModel);this.sidebarPanes.styles=new WebInspector.StylesSidebarPane(this._showStylesSidebar.bind(this));this.sidebarPanes.computedStyle=WebInspector.ComputedStyleWidget.createSidebarWrapper(this.sidebarPanes.styles,sharedSidebarModel);this.sidebarPanes.styles.addEventListener(WebInspector.StylesSidebarPane.Events.SelectorEditingStarted,this._onEditingSelectorStarted.bind(this));this.sidebarPanes.styles.addEventListener(WebInspector.StylesSidebarPane.Events.SelectorEditingEnded,this._onEditingSelectorEnded.bind(this));this.sidebarPanes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPanes.properties=WebInspector.PropertiesWidget.createSidebarWrapper();this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.eventListeners=WebInspector.EventListenersWidget.createSidebarWrapper();WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.moduleSetting("splitVerticallyWhenDockedToRight").addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._loadSidebarViews();this._treeOutlines=[];this._modelToTreeOutline=new Map();WebInspector.targetManager.observeTargets(this);WebInspector.moduleSetting("showUAShadowDOM").addChangeListener(this._showUAShadowDOMChanged.bind(this));WebInspector.targetManager.addModelListener(WebInspector.DOMModel,WebInspector.DOMModel.Events.DocumentUpdated,this._documentUpdatedEvent,this);WebInspector.targetManager.addModelListener(WebInspector.CSSStyleModel,WebInspector.CSSStyleModel.Events.PseudoStateForced,this._pseudoStateForced,this);WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.Events.SidebarPaneAdded,this._extensionSidebarPaneAdded,this);} WebInspector.ElementsPanel._elementsSidebarViewTitleSymbol=Symbol("title");WebInspector.ElementsPanel.prototype={_createElementsToolbar:function() {var toolbar=new WebInspector.ExtensibleToolbar("elements-toolbar");toolbar.element.classList.add("elements-toolbar");toolbar.appendSeparator();return toolbar;},_loadSidebarViews:function() {var extensions=self.runtime.extensions("@WebInspector.Widget");for(var i=0;i * {\n display: none;\n}\n\n.crumbs .crumb.collapsed::before {\n content: \"\\2026\";\n font-weight: bold;\n}\n\n.crumbs .crumb.compact .extra {\n display: none;\n}\n\n.crumbs .crumb.selected, .crumbs .crumb.selected:hover {\n background-color: rgb(56, 121, 217);\n color: white;\n text-shadow: rgba(255, 255, 255, 0.5) 0 0 0;\n}\n\n:host-context(.material) .crumb.selected {\n color: hsl(0, 0%, 35%);\n background-color: transparent !important;\n}\n\n:host-context(.material) .crumb.selected:before {\n color: hsl(217, 89%, 61%) !important;\n}\n\n.crumbs .crumb:hover {\n background-color: rgb(216, 216, 216);\n}\n\n:host-context(.material) .crumb:hover {\n background-color: transparent;\n color: hsl(0, 0%, 20%) !important;\n}\n\n/*# sourceURL=elements/breadcrumbs.css */";Runtime.cachedResources["elements/computedStyleSidebarPane.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.computed-properties {\n padding: 2px 2px 4px 4px;\n -webkit-user-select: text;\n}\n\n.computed-style-property-inherited {\n opacity: 0.5;\n}\n\n.computed-style-trace-button {\n display: none;\n position: absolute;\n border: 0 transparent none;\n background-color: transparent;\n height: 25px;\n width: 26px;\n transform: scale(0.75);\n left: -10px;\n top: -6px;\n opacity: 0.5;\n}\n\n.computed-style-property:hover .computed-style-trace-button {\n display: inline-block;\n}\n\n.computed-style-trace-button:hover {\n opacity: 1;\n}\n\n.computed-style-trace-button > .glyph {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 144px;\n -webkit-mask-position: -224px -24px;\n background-color: rgba(0, 0, 0, 0.75);\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n margin: 0 -1px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.computed-style-trace-button > .glyph {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.computed-style-property {\n position: relative;\n padding-left: 14px;\n}\n\n/*# sourceURL=elements/computedStyleSidebarPane.css */";Runtime.cachedResources["elements/elementsPanel.css"]="/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2009 Anthony Ricaud \n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#elements-content {\n flex: 1 1;\n overflow: auto;\n padding: 2px 0 0 0;\n transform: translateZ(0);\n}\n\n#elements-content:not(.elements-wrap) > div {\n display: inline-block;\n min-width: 100%;\n}\n\n#elements-content.elements-wrap {\n overflow-x: hidden;\n}\n\n.elements-topbar {\n border-bottom: 1px solid hsla(0, 0%, 0%, 0.1);\n flex-shrink: 0;\n}\n\n#elements-crumbs {\n flex: 0 0 19px;\n background-color: white;\n border-top: 1px solid #ccc;\n overflow: hidden;\n height: 19px;\n width: 100%;\n}\n\n.material #elements-crumbs {\n flex: 1 0 28px;\n border: none;\n height: 100%;\n}\n\n.metrics {\n padding: 8px;\n font-size: 10px;\n text-align: center;\n white-space: nowrap;\n}\n\n.metrics .label {\n position: absolute;\n font-size: 10px;\n margin-left: 3px;\n padding-left: 2px;\n padding-right: 2px;\n}\n\n.metrics .position {\n border: 1px rgb(66%, 66%, 66%) dotted;\n background-color: white;\n display: inline-block;\n text-align: center;\n padding: 3px;\n margin: 3px;\n}\n\n.metrics .margin {\n border: 1px dashed;\n background-color: white;\n display: inline-block;\n text-align: center;\n vertical-align: middle;\n padding: 3px;\n margin: 3px;\n}\n\n.metrics .border {\n border: 1px black solid;\n background-color: white;\n display: inline-block;\n text-align: center;\n vertical-align: middle;\n padding: 3px;\n margin: 3px;\n}\n\n.metrics .padding {\n border: 1px grey dashed;\n background-color: white;\n display: inline-block;\n text-align: center;\n vertical-align: middle;\n padding: 3px;\n margin: 3px;\n}\n\n.metrics .content {\n position: static;\n border: 1px gray solid;\n background-color: white;\n display: inline-block;\n text-align: center;\n vertical-align: middle;\n padding: 3px;\n margin: 3px;\n min-width: 80px;\n overflow: visible;\n}\n\n.metrics .content span {\n display: inline-block;\n}\n\n.metrics .editing {\n position: relative;\n z-index: 100;\n cursor: text;\n}\n\n.metrics .left {\n display: inline-block;\n vertical-align: middle;\n}\n\n.metrics .right {\n display: inline-block;\n vertical-align: middle;\n}\n\n.metrics .top {\n display: inline-block;\n}\n\n.metrics .bottom {\n display: inline-block;\n}\n\n.styles-section {\n padding: 2px 2px 4px 4px;\n min-height: 18px;\n white-space: nowrap;\n background-origin: padding;\n background-clip: padding;\n -webkit-user-select: text;\n border-bottom: 1px solid #eee;\n position: relative;\n}\n\n.styles-section:last-child {\n border-bottom: none;\n}\n\n.styles-pane .sidebar-separator {\n border-top: 0 none;\n}\n\n.styles-sidebar-placeholder {\n height: 16px;\n}\n\n.styles-section.read-only {\n background-color: #eee;\n}\n\n.styles-section .style-properties li.not-parsed-ok {\n margin-left: 0;\n}\n\n.styles-section .style-properties li.filter-match,\n.styles-section .simple-selector.filter-match {\n background-color: rgba(255, 255, 0, 0.5);\n}\n\n.styles-section .style-properties li.overloaded.filter-match {\n background-color: rgba(255, 255, 0, 0.25);\n}\n\n.styles-section .style-properties li.not-parsed-ok .exclamation-mark {\n display: inline-block;\n position: relative;\n width: 11px;\n height: 10px;\n margin: 0 7px 0 0;\n top: 1px;\n left: -36px; /* outdent to compensate for the top-level property indent */\n -webkit-user-select: none;\n cursor: default;\n z-index: 1;\n}\n\n.styles-section-title {\n background-origin: padding;\n background-clip: padding;\n word-wrap: break-word;\n white-space: normal;\n}\n\n.styles-section-title .media-list {\n color: #888;\n}\n\n.styles-section-title .media-list.media-matches .media.editable-media {\n color: #222;\n}\n\n.styles-section-title .media:not(.editing-media),\n.styles-section-title .media:not(.editing-media) .subtitle {\n overflow: hidden;\n}\n\n.styles-section-title .media .subtitle {\n float: right;\n color: rgb(85, 85, 85);\n}\n\n.styles-section-subtitle {\n color: rgb(85, 85, 85);\n float: right;\n margin-left: 5px;\n max-width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n\n.styles-section .styles-section-subtitle a {\n color: inherit;\n}\n\n.styles-section .selector {\n color: #888;\n}\n\n.styles-section .simple-selector.selector-matches {\n color: #222;\n}\n\n.styles-section a[data-uncopyable] {\n display: inline-block;\n}\n\n.styles-section a[data-uncopyable]::before {\n content: attr(data-uncopyable);\n text-decoration: underline;\n}\n\n.styles-section .style-properties {\n margin: 0;\n padding: 2px 4px 0 0;\n list-style: none;\n clear: both;\n}\n\n.styles-section.matched-styles .style-properties {\n padding-left: 0;\n}\n\n.no-affect .style-properties li {\n opacity: 0.5;\n}\n\n.no-affect .style-properties li.editing {\n opacity: 1.0;\n}\n\n.styles-section .style-properties li {\n margin-left: 12px;\n padding-left: 22px;\n white-space: normal;\n text-overflow: ellipsis;\n overflow: hidden;\n cursor: auto;\n}\n\n.styles-section .style-properties li .webkit-css-property {\n margin-left: -22px; /* outdent the first line of longhand properties (in an expanded shorthand) to compensate for the \"padding-left\" shift in .styles-section .style-properties li */\n}\n\n.styles-section .style-properties > li {\n padding-left: 38px;\n}\n\n.styles-section .style-properties > li .webkit-css-property {\n margin-left: -38px; /* outdent the first line of the top-level properties to compensate for the \"padding-left\" shift in .styles-section .style-properties > li */\n}\n\n.styles-section .style-properties > li.child-editing {\n padding-left: 8px;\n}\n\n.styles-section .style-properties > li.child-editing .webkit-css-property {\n margin-left: 0;\n}\n\n.styles-section.matched-styles .style-properties li {\n margin-left: 0 !important;\n}\n\n.styles-section .style-properties li.child-editing {\n word-wrap: break-word !important;\n white-space: normal !important;\n padding-left: 0;\n}\n\n.styles-section .style-properties ol {\n display: none;\n margin: 0;\n -webkit-padding-start: 12px;\n list-style: none;\n}\n\n.styles-section .style-properties ol.expanded {\n display: block;\n}\n\n.styles-section.matched-styles .style-properties li.parent .expand-element {\n -webkit-user-select: none;\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 144px;\n margin-right: 2px;\n margin-left: -6px;\n opacity: 0.55;\n width: 8px;\n height: 10px;\n display: inline-block;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.styles-section.matched-styles .style-properties li.parent .expand-element {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.styles-section.matched-styles .style-properties li.parent .expand-element {\n background-position: -4px -96px;\n}\n\n.styles-section.matched-styles .style-properties li.parent.expanded .expand-element {\n background-position: -20px -96px;\n}\n\n.styles-section .style-properties li .info {\n padding-top: 4px;\n padding-bottom: 3px;\n}\n\n.styles-section.matched-styles:not(.read-only):hover .style-properties .enabled-button {\n visibility: visible;\n}\n\n.styles-section.matched-styles:not(.read-only) .style-properties li.disabled .enabled-button {\n visibility: visible;\n}\n\n.styles-section .style-properties .enabled-button {\n visibility: hidden;\n float: left;\n font-size: 10px;\n margin: 0;\n vertical-align: top;\n position: relative;\n z-index: 1;\n width: 18px;\n left: -40px; /* original -2px + (-38px) to compensate for the first line outdent */\n top: 1px;\n}\n\n.styles-section.matched-styles .style-properties ol.expanded {\n margin-left: 16px;\n}\n\n.styles-section .style-properties .overloaded:not(.has-ignorable-error),\n.styles-section .style-properties .inactive,\n.styles-section .style-properties .disabled,\n.styles-section .style-properties .not-parsed-ok:not(.has-ignorable-error) {\n text-decoration: line-through;\n}\n\n.styles-section .style-properties .has-ignorable-error .webkit-css-property {\n color: inherit;\n}\n\n.styles-section .style-properties .implicit,\n.styles-section .style-properties .inherited {\n opacity: 0.5;\n}\n\n.styles-section .style-properties .has-ignorable-error {\n color: gray;\n}\n\n.styles-element-state-pane {\n overflow: hidden;\n height: 60px;\n padding-left: 2px;\n border-bottom: 1px solid rgb(189, 189, 189);\n}\n\n@keyframes styles-element-state-pane-slidein {\n from {\n margin-top: -60px;\n }\n to {\n margin-top: 0px;\n }\n}\n\n@keyframes styles-element-state-pane-slideout {\n from {\n margin-top: 0px;\n }\n to {\n margin-top: -60px;\n }\n}\n\n.styles-sidebar-toolbar-pane {\n position: relative;\n animation-duration: 0.1s;\n animation-direction: normal;\n}\n\n.styles-sidebar-toolbar-pane-container {\n position: relative;\n max-height: 60px;\n overflow: hidden;\n}\n\n.styles-element-state-pane {\n background-color: #f3f3f3;\n border-bottom: 1px solid rgb(189, 189, 189);\n margin-top: 0;\n}\n\n\n.styles-element-state-pane > div {\n margin: 6px 4px 2px;\n}\n\n.styles-element-state-pane > table {\n width: 100%;\n border-spacing: 0;\n}\n\n.styles-element-state-pane td {\n padding: 0;\n}\n\n.styles-animations-controls-pane > * {\n margin: 6px 4px;\n}\n\n.styles-animations-controls-pane {\n border-bottom: 1px solid rgb(189, 189, 189);\n height: 60px;\n overflow: hidden;\n background-color: #eee;\n}\n\n.animations-controls {\n width: 100%;\n max-width: 200px;\n display: flex;\n align-items: center;\n}\n\n.animations-controls > .toolbar {\n display: inline-block;\n}\n\n.animations-controls > input {\n flex-grow: 1;\n margin-right: 10px;\n}\n\n.animations-controls > .playback-label {\n width: 35px;\n}\n\n.styles-selector {\n cursor: text;\n}\n\n.image-preview-container {\n background: transparent;\n text-align: center;\n}\n\n.image-preview-container img {\n margin: 2px auto;\n max-width: 100px;\n max-height: 100px;\n background-image: url(Images/checker.png);\n -webkit-user-select: text;\n -webkit-user-drag: auto;\n}\n\n.sidebar-pane.composite {\n position: absolute;\n}\n\n.metrics {\n border-bottom: 1px solid #ccc;\n}\n\n.metrics-and-styles .metrics {\n border-top: 1px solid #ccc;\n border-bottom: none;\n}\n\n.sidebar-pane.composite .metrics {\n height: 190px;\n display: flex;\n flex-direction: column;\n -webkit-align-items: center;\n -webkit-justify-content: center;\n}\n\n.sidebar-pane .metrics-and-styles,\n.sidebar-pane .metrics-and-computed {\n display: flex !important;\n flex-direction: column !important;\n position: relative;\n}\n\n.sidebar-pane .style-panes-wrapper {\n transform: translateZ(0);\n flex: 1;\n overflow-y: auto;\n position: relative;\n}\n\n.styles-sidebar-pane-toolbar {\n border-bottom: 1px solid #eee;\n}\n\n.styles-sidebar-pane-filter-box {\n flex: auto;\n display: flex;\n}\n\n.styles-sidebar-pane-filter-box > input {\n outline: none !important;\n border: none;\n width: 100%;\n background: transparent;\n margin-left: 4px;\n}\n\n.styles-filter-engaged {\n background-color: rgba(255, 255, 0, 0.5);\n}\n\n.sidebar-pane.composite .platform-fonts {\n -webkit-user-select: text;\n}\n\n.sidebar-pane.composite .platform-fonts .sidebar-separator {\n height: 24px;\n background-color: #f1f1f1;\n border-color: #ddd;\n display: flex;\n align-items: center;\n}\n\n.sidebar-pane.composite .platform-fonts .stats-section {\n margin: 5px 0;\n}\n\n.sidebar-pane.composite .platform-fonts .font-stats-item {\n padding-left: 1em;\n}\n\n.sidebar-pane.composite .platform-fonts .font-stats-item .delimeter {\n margin: 0 1ex 0 1ex;\n}\n\n.sidebar-pane.composite .metrics-and-styles .metrics {\n border-bottom: none;\n}\n\n.sidebar-pane > .split-widget {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.styles-section:not(.read-only) .style-properties .webkit-css-property.styles-panel-hovered,\n.styles-section:not(.read-only) .style-properties .value .styles-panel-hovered,\n.styles-section:not(.read-only) .style-properties .value.styles-panel-hovered,\n.styles-section:not(.read-only) span.simple-selector.styles-panel-hovered {\n text-decoration: underline;\n cursor: default;\n}\n\n.styles-clipboard-only {\n display: inline-block;\n width: 0;\n opacity: 0;\n pointer-events: none;\n white-space: pre;\n}\n\n.popover-icon {\n margin-left: 1px;\n margin-right: 2px;\n width: 10px;\n height: 10px;\n position: relative;\n top: 1px;\n display: inline-block;\n line-height: 1px;\n -webkit-user-select: none;\n}\n\n.bezier-icon {\n background-color: #9C27B0;\n border-radius: 2px;\n}\n\n.bezier-icon path {\n stroke: white;\n stroke-width: 1.5;\n stroke-linecap: square;\n fill: none;\n}\n\n.swatch {\n background-image: url(Images/checker.png);\n}\n\nli.child-editing .styles-clipboard-only {\n display: none;\n}\n\nli.editing .swatch,\nli.editing .enabled-button {\n display: none !important;\n}\n\n.sidebar-separator {\n background-color: #ddd;\n padding: 0 5px;\n border-top: 1px solid #ccc;\n border-bottom: 1px solid #ccc;\n color: rgb(50, 50, 50);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n line-height: 16px;\n}\n\n.swatch-inner {\n width: 100%;\n height: 100%;\n display: inline-block;\n border: 1px solid rgba(128, 128, 128, 0.6);\n}\n\n.swatch-inner:hover {\n border: 1px solid rgba(64, 64, 64, 0.8);\n}\n\n.animation-section-body {\n display: none;\n}\n\n.animation-section-body.expanded {\n display: block;\n}\n\n.animation-section-body .section {\n border-bottom: 1px solid rgb(191, 191, 191);\n}\n\n.animationsHeader {\n padding-top: 23px;\n}\n\n.global-animations-toolbar {\n position: absolute;\n top: 0;\n width: 100%;\n background-color: #eee;\n border-bottom: 1px solid rgb(163, 163, 163);\n padding-left: 10px;\n}\n\n.events-pane .section:not(:first-of-type) {\n border-top: 1px solid rgb(231, 231, 231);\n}\n\n.events-pane .section {\n margin: 0;\n}\n\n.style-properties li.editing {\n margin-left: 10px;\n text-overflow: clip;\n}\n\n.style-properties li.editing-sub-part {\n padding: 3px 6px 8px 18px;\n margin: -1px -6px -8px -6px;\n text-overflow: clip;\n}\n\n.properties-widget-section {\n padding: 2px 0px 2px 5px;\n}\n\n/*# sourceURL=elements/elementsPanel.css */";Runtime.cachedResources["elements/elementsTreeOutline.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.elements-disclosure {\n width: 100%;\n display: inline-block;\n line-height: normal;\n}\n\n.elements-disclosure li {\n padding: 0 0 0 14px;\n margin-top: 1px;\n margin-left: -2px;\n word-wrap: break-word;\n}\n\n.elements-disclosure li.parent {\n margin-left: -13px;\n}\n\n.elements-disclosure li.parent::before {\n float: left;\n width: 10px;\n box-sizing: border-box;\n}\n\n.elements-disclosure li.parent::before {\n -webkit-user-select: none;\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 144px;\n content: \"a\";\n color: transparent;\n text-shadow: none;\n margin-right: 1px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.elements-disclosure li.parent::before {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.elements-disclosure li.parent::before {\n -webkit-mask-position: -4px -96px;\n background-color: rgb(110, 110, 110);\n}\n\n.elements-disclosure li .selection {\n display: none;\n position: absolute;\n left: 0;\n right: 0;\n height: 15px;\n z-index: -1;\n}\n\n.elements-disclosure li.hovered:not(.selected) .selection {\n display: block;\n left: 3px;\n right: 3px;\n background-color: rgba(56, 121, 217, 0.1);\n border-radius: 5px;\n}\n\n.elements-disclosure li.parent.expanded::before {\n -webkit-mask-position: -20px -96px;\n}\n\n.elements-disclosure li.selected .selection {\n display: block;\n background-color: #dadada;\n}\n\n.elements-disclosure ol {\n list-style-type: none;\n -webkit-padding-start: 12px;\n margin: 0;\n}\n\n.elements-disclosure ol.children {\n display: none;\n}\n\n.elements-disclosure ol.children.expanded {\n display: block;\n}\n\n.elements-disclosure li .webkit-html-tag.close {\n margin-left: -12px;\n}\n\n.elements-disclosure > ol {\n position: relative;\n margin: 0;\n cursor: default;\n min-width: 100%;\n min-height: 100%;\n -webkit-transform: translateZ(0);\n padding-left: 2px;\n}\n\n.elements-disclosure ol:focus li.selected {\n color: white;\n}\n\n.elements-disclosure ol:focus li.parent.selected::before {\n background-color: white;\n}\n\n.elements-disclosure ol:focus li.selected * {\n color: inherit;\n}\n\n.elements-disclosure ol:focus li.selected .selection {\n background-color: rgb(56, 121, 217);\n}\n\n.elements-tree-outline ol.shadow-root {\n margin-left: 5px;\n padding-left: 5px;\n border-left: 1px solid rgb(190, 190, 190);\n}\n\n.elements-tree-outline ol.shadow-root-depth-4 {\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.elements-tree-outline ol.shadow-root-depth-3 {\n background-color: rgba(0, 0, 0, 0.03);\n}\n\n.elements-tree-outline ol.shadow-root-depth-2 {\n background-color: rgba(0, 0, 0, 0.02);\n}\n\n.elements-tree-outline ol.shadow-root-depth-1 {\n background-color: rgba(0, 0, 0, 0.01);\n}\n\n.elements-tree-outline ol.shadow-root-deep {\n background-color: transparent;\n}\n\n.elements-tree-editor {\n -webkit-user-select: text;\n -webkit-user-modify: read-write-plaintext-only;\n}\n\n.elements-disclosure li.elements-drag-over .selection {\n display: block;\n margin-top: -2px;\n border-top: 2px solid rgb(56, 121, 217);\n}\n\n.elements-disclosure li.in-clipboard .highlight {\n outline: 1px dotted darkgrey;\n}\n\n.CodeMirror {\n /* Consistent with the .editing class in inspector.css */\n box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n outline: 1px solid rgb(66%, 66%, 66%) !important;\n background-color: white;\n}\n\n.CodeMirror-lines {\n padding: 0;\n}\n\n.CodeMirror pre {\n padding: 0;\n}\n\nbutton, input, select {\n font-family: inherit;\n font-size: inherit;\n}\n\n.editing {\n -webkit-user-select: text;\n box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n outline: 1px solid rgb(66%, 66%, 66%) !important;\n background-color: white;\n -webkit-user-modify: read-write-plaintext-only;\n text-overflow: clip !important;\n padding-left: 2px;\n margin-left: -2px;\n padding-right: 2px;\n margin-right: -2px;\n margin-bottom: -1px;\n padding-bottom: 1px;\n opacity: 1.0 !important;\n}\n\n.editing,\n.editing * {\n color: #222 !important;\n text-decoration: none !important;\n}\n\n.editing br {\n display: none;\n}\n\n.elements-gutter-decoration {\n position: absolute;\n left: 1px;\n margin-top: 2px;\n height: 8px;\n width: 8px;\n border-radius: 4px;\n border: 1px solid orange;\n background-color: orange;\n}\n\n.elements-gutter-decoration.elements-has-decorated-children {\n opacity: 0.5;\n}\n\n.add-attribute {\n margin-left: 1px;\n margin-right: 1px;\n white-space: nowrap;\n}\n\n.elements-tree-element-pick-node-1 {\n border-radius: 3px;\n padding: 1px 0 1px 0;\n -webkit-animation: elements-tree-element-pick-node-animation-1 0.5s 1;\n}\n\n.elements-tree-element-pick-node-2 {\n border-radius: 3px;\n padding: 1px 0 1px 0;\n -webkit-animation: elements-tree-element-pick-node-animation-2 0.5s 1;\n}\n\n@-webkit-keyframes elements-tree-element-pick-node-animation-1 {\n from { background-color: rgb(255, 210, 126); }\n to { background-color: inherit; }\n}\n\n@-webkit-keyframes elements-tree-element-pick-node-animation-2 {\n from { background-color: rgb(255, 210, 126); }\n to { background-color: inherit; }\n}\n\n.pick-node-mode {\n cursor: pointer;\n}\n\n.webkit-html-attribute-value a {\n cursor: default !important;\n}\n\n.elements-tree-nowrap, .elements-tree-nowrap .li {\n white-space: pre !important;\n}\n\n.elements-disclosure .elements-tree-nowrap li {\n word-wrap: normal;\n}\n\n/* DOM update highlight */\n@-webkit-keyframes dom-update-highlight-animation {\n from {\n background-color: rgb(158, 54, 153);\n color: white;\n }\n 80% {\n background-color: rgb(245, 219, 244);\n color: inherit;\n }\n to {\n background-color: inherit;\n }\n}\n\n.dom-update-highlight {\n -webkit-animation: dom-update-highlight-animation 1.4s 1 cubic-bezier(0, 0, 0.2, 1);\n border-radius: 2px;\n}\n\n.elements-disclosure.single-node li {\n padding-left: 2px;\n}\n\n.elements-tree-shortcut-title {\n color: rgb(87, 87, 87);\n}\n\nol:hover > li > .elements-tree-shortcut-link {\n display: initial;\n}\n\n.elements-tree-shortcut-link {\n color: rgb(87, 87, 87);\n display: none;\n}\n\n/*# sourceURL=elements/elementsTreeOutline.css */";Runtime.cachedResources["elements/spectrum.css"]="/* https://github.com/bgrins/spectrum */\n:host {\n width: 226px;\n height: 240px;\n -webkit-user-select: none;\n}\n\n.spectrum-color {\n position: relative;\n width: 226px;\n height: 124px;\n border-radius: 2px 2px 0 0;\n overflow: hidden;\n}\n\n.spectrum-display-value {\n -webkit-user-select: text;\n display: inline-block;\n padding-left: 2px;\n}\n\n.spectrum-hue {\n top: 140px;\n}\n\n.spectrum-alpha {\n top: 159px;\n background-image: url(Images/checker.png);\n background-size: 12px 11px;\n}\n\n.spectrum-alpha-background {\n height: 100%;\n border-radius: 2px;\n}\n\n.spectrum-hue, .spectrum-alpha {\n position: absolute;\n right: 16px;\n width: 130px;\n height: 11px;\n border-radius: 2px;\n}\n\n.spectrum-dragger,\n.spectrum-slider {\n -webkit-user-select: none;\n}\n\n.spectrum-sat {\n background-image: linear-gradient(to right, white, rgba(204, 154, 129, 0));\n}\n\n.spectrum-val {\n background-image: linear-gradient(to top, black, rgba(204, 154, 129, 0));\n}\n\n.spectrum-hue {\n background: linear-gradient(to left, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);\n}\n\n.spectrum-dragger {\n border-radius: 12px;\n height: 12px;\n width: 12px;\n border: 1px solid white;\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n background: black;\n box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.24);\n}\n\n.spectrum-slider {\n position: absolute;\n top: -1px;\n cursor: pointer;\n width: 13px;\n height: 13px;\n border-radius: 13px;\n background-color: rgb(248, 248, 248);\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\n}\n\n.swatch {\n width: 16px;\n height: 16px;\n margin: 0;\n position: absolute;\n top: 148px;\n left: 48px;\n background-image: url(Images/checker.png);\n border-radius: 16px;\n}\n\n.swatch-inner {\n width: 100%;\n height: 100%;\n display: inline-block;\n border-radius: 16px;\n}\n\n.swatch-inner-white {\n border: 1px solid #ddd;\n}\n\n.spectrum-text {\n position: absolute;\n top: 184px;\n left: 16px;\n}\n\n.spectrum-text-value {\n display: inline-block;\n width: 36px;\n overflow: hidden;\n text-align: center;\n border: 1px solid #dadada;\n border-radius: 2px;\n margin-right: 6px;\n line-height: 20px;\n font-size: 11px;\n padding: 0;\n color: #333;\n white-space: nowrap;\n}\n\n.spectrum-text-label {\n letter-spacing: 35.5px;\n margin-top: 8px;\n display: block;\n color: #969696;\n margin-left: 15px;\n width: 162px;\n}\n\n.spectrum-text-hex > .spectrum-text-value {\n width: 162px;\n}\n\n.spectrum-text-hex > .spectrum-text-label {\n letter-spacing: normal;\n margin-left: 0px;\n text-align: center;\n}\n\n.spectrum-palette-value {\n background-color: rgb(65, 75, 217);\n border-radius: 2px;\n margin-top: 12px;\n margin-left: 12px;\n width: 12px;\n height: 12px;\n display: inline-block;\n}\n\n.spectrum-palette-container {\n position: absolute;\n top: 244px;\n}\n\n.spectrum-display-switcher {\n top: 196px;\n position: absolute;\n right: 16px;\n padding: 2px;\n border-radius: 2px;\n}\n\n.spectrum-display-switcher:hover {\n background-color: #EEEEEE;\n}\n\n.spectrum-eye-dropper {\n width: 32px;\n height: 24px;\n position: absolute;\n left: 12px;\n top: 144px;\n}\n\n/*# sourceURL=elements/spectrum.css */";