Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5152)

Unified Diff: chrome_linux64/resources/inspector/ElementsPanel.js

Issue 85333005: Update reference builds to Chrome 32.0.1700.19 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/reference_builds/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome_linux64/resources/inspector/ElementsPanel.js
===================================================================
--- chrome_linux64/resources/inspector/ElementsPanel.js (revision 237140)
+++ chrome_linux64/resources/inspector/ElementsPanel.js (working copy)
@@ -1,7 +1,7 @@
WebInspector.CSSNamedFlowCollectionsView=function()
{WebInspector.SidebarView.call(this,WebInspector.SidebarView.SidebarPosition.Start);this.registerRequiredCSS("cssNamedFlows.css");this._namedFlows={};this._contentNodes={};this._regionNodes={};this.element.addStyleClass("css-named-flow-collections-view");this.element.addStyleClass("fill");this._statusElement=document.createElement("span");this._statusElement.textContent=WebInspector.UIString("CSS Named Flows");var sidebarHeader=this.firstElement().createChild("div","tabbed-pane-header selected sidebar-header");var tab=sidebarHeader.createChild("div","tabbed-pane-header-tab");tab.createChild("span","tabbed-pane-header-tab-title").textContent=WebInspector.UIString("CSS Named Flows");this._sidebarContentElement=this.firstElement().createChild("div","sidebar-content outline-disclosure");this._flowListElement=this._sidebarContentElement.createChild("ol");this._flowTree=new TreeOutline(this._flowListElement);this._emptyElement=document.createElement("div");this._emptyElement.addStyleClass("info");this._emptyElement.textContent=WebInspector.UIString("No CSS Named Flows");this._tabbedPane=new WebInspector.TabbedPane();this._tabbedPane.closeableTabs=true;this._tabbedPane.show(this.secondElement());}
WebInspector.CSSNamedFlowCollectionsView.prototype={showInDrawer:function()
-{WebInspector.showViewInDrawer(this._statusElement,this);},reset:function()
+{WebInspector.inspectorView.showCloseableViewInDrawer("css-flows",WebInspector.UIString("CSS Flows"),this);},reset:function()
{if(!this._document)
return;WebInspector.cssModel.getNamedFlowCollectionAsync(this._document.id,this._resetNamedFlows.bind(this));},_setDocument:function(document)
{this._document=document;this.reset();},_documentUpdated:function(event)
@@ -220,15 +220,15 @@
{var proto=this;var result={};var counter=1;while(proto){result[counter++]=proto;proto=proto.__proto__;}
return result;}
object.callFunction(protoList,undefined,nodePrototypesReady.bind(this));object.release();}
-function nodePrototypesReady(object)
-{if(!object)
+function nodePrototypesReady(object,wasThrown)
+{if(!object||wasThrown)
return;object.getOwnProperties(fillSection.bind(this));}
function fillSection(prototypes)
{if(!prototypes)
return;var body=this.bodyElement;body.removeChildren();this.sections=[];for(var i=0;i<prototypes.length;++i){if(!parseInt(prototypes[i].name,10))
continue;var prototype=prototypes[i].value;var title=prototype.description;if(title.match(/Prototype$/))
title=title.replace(/Prototype$/,"");var section=new WebInspector.ObjectPropertiesSection(prototype,title);this.sections.push(section);body.appendChild(section.element);}}},__proto__:WebInspector.SidebarPane.prototype};WebInspector.StylesSidebarPane=function(computedStylePane,setPseudoClassCallback)
-{WebInspector.SidebarPane.call(this,WebInspector.UIString("Styles"));this.settingsSelectElement=document.createElement("select");this.settingsSelectElement.className="select-settings";var option=document.createElement("option");option.value=WebInspector.Color.Format.Original;option.label=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"As authored":"As Authored");this.settingsSelectElement.appendChild(option);option=document.createElement("option");option.value=WebInspector.Color.Format.HEX;option.label=WebInspector.UIString("Hex Colors");this.settingsSelectElement.appendChild(option);option=document.createElement("option");option.value=WebInspector.Color.Format.RGB;option.label=WebInspector.UIString("RGB Colors");this.settingsSelectElement.appendChild(option);option=document.createElement("option");option.value=WebInspector.Color.Format.HSL;option.label=WebInspector.UIString("HSL Colors");this.settingsSelectElement.appendChild(option);var muteEventListener=function(event){event.consume(true);};this.settingsSelectElement.addEventListener("click",muteEventListener,true);this.settingsSelectElement.addEventListener("change",this._changeSetting.bind(this),false);this._updateColorFormatFilter();this.titleElement.appendChild(this.settingsSelectElement);this._elementStateButton=document.createElement("button");this._elementStateButton.className="pane-title-button element-state";this._elementStateButton.title=WebInspector.UIString("Toggle Element State");this._elementStateButton.addEventListener("click",this._toggleElementStatePane.bind(this),false);this.titleElement.appendChild(this._elementStateButton);var addButton=document.createElement("button");addButton.className="pane-title-button add";addButton.id="add-style-button-test-id";addButton.title=WebInspector.UIString("New Style Rule");addButton.addEventListener("click",this._createNewRule.bind(this),false);this.titleElement.appendChild(addButton);this._computedStylePane=computedStylePane;computedStylePane._stylesSidebarPane=this;this._setPseudoClassCallback=setPseudoClassCallback;this.element.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);WebInspector.settings.colorFormat.addChangeListener(this._colorFormatSettingChanged.bind(this));this._createElementStatePane();this.bodyElement.appendChild(this._elementStatePane);this._sectionsContainer=document.createElement("div");this.bodyElement.appendChild(this._sectionsContainer);this._spectrumHelper=new WebInspector.SpectrumPopupHelper();this._linkifier=new WebInspector.Linkifier(new WebInspector.Linkifier.DefaultCSSFormatter());WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified,this._attributeChanged,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved,this._attributeChanged,this);WebInspector.settings.showUserAgentStyles.addChangeListener(this._showUserAgentStylesSettingChanged.bind(this));this.element.addEventListener("mousemove",this._mouseMovedOverElement.bind(this),false);document.body.addEventListener("keydown",this._keyDown.bind(this),false);document.body.addEventListener("keyup",this._keyUp.bind(this),false);}
+{WebInspector.SidebarPane.call(this,WebInspector.UIString("Styles"));this.settingsSelectElement=document.createElement("select");this.settingsSelectElement.className="select-settings";var option=document.createElement("option");option.value=WebInspector.Color.Format.Original;option.label=WebInspector.UIString(WebInspector.useLowerCaseMenuTitles()?"As authored":"As Authored");this.settingsSelectElement.appendChild(option);option=document.createElement("option");option.value=WebInspector.Color.Format.HEX;option.label=WebInspector.UIString("Hex Colors");this.settingsSelectElement.appendChild(option);option=document.createElement("option");option.value=WebInspector.Color.Format.RGB;option.label=WebInspector.UIString("RGB Colors");this.settingsSelectElement.appendChild(option);option=document.createElement("option");option.value=WebInspector.Color.Format.HSL;option.label=WebInspector.UIString("HSL Colors");this.settingsSelectElement.appendChild(option);var muteEventListener=function(event){event.consume(true);};this.settingsSelectElement.addEventListener("click",muteEventListener,true);this.settingsSelectElement.addEventListener("change",this._changeSetting.bind(this),false);this._updateColorFormatFilter();this.titleElement.appendChild(this.settingsSelectElement);this._elementStateButton=document.createElement("button");this._elementStateButton.className="pane-title-button element-state";this._elementStateButton.title=WebInspector.UIString("Toggle Element State");this._elementStateButton.addEventListener("click",this._toggleElementStatePane.bind(this),false);this.titleElement.appendChild(this._elementStateButton);var addButton=document.createElement("button");addButton.className="pane-title-button add";addButton.id="add-style-button-test-id";addButton.title=WebInspector.UIString("New Style Rule");addButton.addEventListener("click",this._createNewRule.bind(this),false);this.titleElement.appendChild(addButton);this._computedStylePane=computedStylePane;computedStylePane._stylesSidebarPane=this;this._setPseudoClassCallback=setPseudoClassCallback;this.element.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);WebInspector.settings.colorFormat.addChangeListener(this._colorFormatSettingChanged.bind(this));this._createElementStatePane();this.bodyElement.appendChild(this._elementStatePane);this._sectionsContainer=document.createElement("div");this.bodyElement.appendChild(this._sectionsContainer);this._spectrumHelper=new WebInspector.SpectrumPopupHelper();this._linkifier=new WebInspector.Linkifier(new WebInspector.Linkifier.DefaultCSSFormatter());WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified,this._attributeChanged,this);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved,this._attributeChanged,this);WebInspector.settings.showUserAgentStyles.addChangeListener(this._showUserAgentStylesSettingChanged.bind(this));this.element.addStyleClass("styles-pane");this.element.enableStyleClass("show-user-styles",WebInspector.settings.showUserAgentStyles.get());this.element.addEventListener("mousemove",this._mouseMovedOverElement.bind(this),false);document.body.addEventListener("keydown",this._keyDown.bind(this),false);document.body.addEventListener("keyup",this._keyUp.bind(this),false);}
WebInspector.StylesSidebarPane.PseudoIdNames=["","first-line","first-letter","before","after","selection","","-webkit-scrollbar","-webkit-file-upload-button","-webkit-input-placeholder","-webkit-slider-thumb","-webkit-search-cancel-button","-webkit-search-decoration","-webkit-search-results-decoration","-webkit-search-results-button","-webkit-media-controls-panel","-webkit-media-controls-play-button","-webkit-media-controls-mute-button","-webkit-media-controls-timeline","-webkit-media-controls-timeline-container","-webkit-media-controls-volume-slider","-webkit-media-controls-volume-slider-container","-webkit-media-controls-current-time-display","-webkit-media-controls-time-remaining-display","-webkit-media-controls-seek-back-button","-webkit-media-controls-seek-forward-button","-webkit-media-controls-fullscreen-button","-webkit-media-controls-rewind-button","-webkit-media-controls-return-to-realtime-button","-webkit-media-controls-toggle-closed-captions-button","-webkit-media-controls-status-display","-webkit-scrollbar-thumb","-webkit-scrollbar-button","-webkit-scrollbar-track","-webkit-scrollbar-track-piece","-webkit-scrollbar-corner","-webkit-resizer","-webkit-inner-spin-button","-webkit-outer-spin-button"];WebInspector.StylesSidebarPane._colorRegex=/((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g;WebInspector.StylesSidebarPane.createExclamationMark=function(property)
{var exclamationElement=document.createElement("div");exclamationElement.className="exclamation-mark"+(WebInspector.StylesSidebarPane._ignoreErrorsForProperty(property)?"":" warning-icon-small");exclamationElement.title=WebInspector.CSSMetadata.cssPropertiesMetainfo.keySet()[property.name.toLowerCase()]?WebInspector.UIString("Invalid property value."):WebInspector.UIString("Unknown property name.");return exclamationElement;}
WebInspector.StylesSidebarPane._colorFormat=function(color)
@@ -310,8 +310,7 @@
return;var attrStyle={style:styles.attributesStyle,editable:false};attrStyle.selectorText=node.nodeNameInCorrectCase()+"["+WebInspector.UIString("Attributes Style")+"]";styleRules.push(attrStyle);}
styleRules.push({computedStyle:true,selectorText:"",style:nodeComputedStyle,editable:false});if(!!node.pseudoType())
styleRules.push({isStyleSeparator:true,isPlaceholder:true});if(styles.inlineStyle&&node.nodeType()===Node.ELEMENT_NODE){var inlineStyle={selectorText:"element.style",style:styles.inlineStyle,isAttribute:true};styleRules.push(inlineStyle);}
-var addedAttributesStyle;for(var i=styles.matchedCSSRules.length-1;i>=0;--i){var rule=styles.matchedCSSRules[i];if(!WebInspector.settings.showUserAgentStyles.get()&&(rule.isUser||rule.isUserAgent))
-continue;if((rule.isUser||rule.isUserAgent)&&!addedAttributesStyle){addedAttributesStyle=true;addAttributesStyle();}
+var addedAttributesStyle;for(var i=styles.matchedCSSRules.length-1;i>=0;--i){var rule=styles.matchedCSSRules[i];if((rule.isUser||rule.isUserAgent)&&!addedAttributesStyle){addedAttributesStyle=true;addAttributesStyle();}
styleRules.push({style:rule.style,selectorText:rule.selectorText,media:rule.media,sourceURL:rule.resourceURL(),rule:rule,editable:!!(rule.style&&rule.style.id)});}
if(!addedAttributesStyle)
addAttributesStyle();var parentNode=node.parentNode;function insertInheritedNodeSeparator(node)
@@ -319,8 +318,7 @@
for(var parentOrdinal=0;parentOrdinal<styles.inherited.length;++parentOrdinal){var parentStyles=styles.inherited[parentOrdinal];var separatorInserted=false;if(parentStyles.inlineStyle){if(this._containsInherited(parentStyles.inlineStyle)){var inlineStyle={selectorText:WebInspector.UIString("Style Attribute"),style:parentStyles.inlineStyle,isAttribute:true,isInherited:true,parentNode:parentNode};if(!separatorInserted){insertInheritedNodeSeparator(parentNode);separatorInserted=true;}
styleRules.push(inlineStyle);}}
for(var i=parentStyles.matchedCSSRules.length-1;i>=0;--i){var rulePayload=parentStyles.matchedCSSRules[i];if(!this._containsInherited(rulePayload.style))
-continue;var rule=rulePayload;if(!WebInspector.settings.showUserAgentStyles.get()&&(rule.isUser||rule.isUserAgent))
-continue;if(!separatorInserted){insertInheritedNodeSeparator(parentNode);separatorInserted=true;}
+continue;var rule=rulePayload;if(!separatorInserted){insertInheritedNodeSeparator(parentNode);separatorInserted=true;}
styleRules.push({style:rule.style,selectorText:rule.selectorText,media:rule.media,sourceURL:rule.resourceURL(),rule:rule,isInherited:true,parentNode:parentNode,editable:!!(rule.style&&rule.style.id)});}
parentNode=parentNode.parentNode;}
return styleRules;},_markUsedProperties:function(styleRules,usedProperties)
@@ -336,17 +334,18 @@
delete propertyToEffectiveRule[canonicalName].usedProperties[canonicalName];}
styleRule.usedProperties[canonicalName]=true;usedProperties[canonicalName]=true;propertyToEffectiveRule[canonicalName]=styleRule;}}},_refreshSectionsForStyleRules:function(styleRules,usedProperties,editedSection)
{for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];var section=styleRule.section;if(styleRule.computedStyle){section._usedProperties=usedProperties;section.update();}else{section._usedProperties=styleRule.usedProperties;section.update(section===editedSection);}}},_rebuildSectionsForStyleRules:function(styleRules,usedProperties,anchorElement)
-{var sections=[];var lastWasSeparator=true;for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];if(styleRule.isStyleSeparator){var separatorElement=document.createElement("div");if(styleRule.isPlaceholder){separatorElement.className="styles-sidebar-placeholder";this._sectionsContainer.insertBefore(separatorElement,anchorElement);continue;}
+{var sections=[];for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];if(styleRule.isStyleSeparator){var separatorElement=document.createElement("div");if(styleRule.isPlaceholder){separatorElement.className="styles-sidebar-placeholder";this._sectionsContainer.insertBefore(separatorElement,anchorElement);continue;}
separatorElement.className="sidebar-separator";if(styleRule.node){var link=WebInspector.DOMPresentationUtils.linkifyNodeReference(styleRule.node);separatorElement.appendChild(document.createTextNode(WebInspector.UIString("Inherited from")+" "));separatorElement.appendChild(link);if(!sections.inheritedPropertiesSeparatorElement)
sections.inheritedPropertiesSeparatorElement=separatorElement;}else if("pseudoId"in styleRule){var pseudoName=WebInspector.StylesSidebarPane.PseudoIdNames[styleRule.pseudoId];if(pseudoName)
separatorElement.textContent=WebInspector.UIString("Pseudo ::%s element",pseudoName);else
separatorElement.textContent=WebInspector.UIString("Pseudo element");}else
-separatorElement.textContent=styleRule.text;this._sectionsContainer.insertBefore(separatorElement,anchorElement);lastWasSeparator=true;continue;}
+separatorElement.textContent=styleRule.text;this._sectionsContainer.insertBefore(separatorElement,anchorElement);continue;}
var computedStyle=styleRule.computedStyle;var editable=styleRule.editable;if(typeof editable==="undefined")
editable=true;if(computedStyle)
-var section=new WebInspector.ComputedStylePropertiesSection(this,styleRule,usedProperties);else{var section=new WebInspector.StylePropertiesSection(this,styleRule,editable,styleRule.isInherited,lastWasSeparator);section._markSelectorMatches();}
-section.expanded=true;if(computedStyle){this._computedStylePane.bodyElement.appendChild(section.element);lastWasSeparator=true;}else{this._sectionsContainer.insertBefore(section.element,anchorElement);lastWasSeparator=false;}
-sections.push(section);}
+var section=new WebInspector.ComputedStylePropertiesSection(this,styleRule,usedProperties);else{var section=new WebInspector.StylePropertiesSection(this,styleRule,editable,styleRule.isInherited);section._markSelectorMatches();}
+section.expanded=true;if(computedStyle)
+this._computedStylePane.bodyElement.appendChild(section.element);else
+this._sectionsContainer.insertBefore(section.element,anchorElement);sections.push(section);}
return sections;},_containsInherited:function(style)
{var properties=style.allProperties;for(var i=0;i<properties.length;++i){var property=properties[i];if(property.isLive&&WebInspector.CSSMetadata.isPropertyInherited(property.name))
return true;}
@@ -367,8 +366,8 @@
return;this._setPseudoClassCallback(node.id,event.target.state,event.target.checked);}
function createCheckbox(state)
{var td=document.createElement("td");var label=document.createElement("label");var input=document.createElement("input");input.type="checkbox";input.state=state;input.addEventListener("click",clickListener.bind(this),false);inputs.push(input);label.appendChild(input);label.appendChild(document.createTextNode(":"+state));td.appendChild(label);return td;}
-var tr=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"active"));tr.appendChild(createCheckbox.call(this,"hover"));table.appendChild(tr);tr=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"focus"));tr.appendChild(createCheckbox.call(this,"visited"));table.appendChild(tr);this._elementStatePane.appendChild(table);},_showUserAgentStylesSettingChanged:function()
-{this._rebuildUpdate();},willHide:function()
+var tr=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"active"));tr.appendChild(createCheckbox.call(this,"hover"));table.appendChild(tr);tr=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"focus"));tr.appendChild(createCheckbox.call(this,"visited"));table.appendChild(tr);this._elementStatePane.appendChild(table);},_showUserAgentStylesSettingChanged:function(event)
+{var showStyles=(event.data);this.element.enableStyleClass("show-user-styles",showStyles);},willHide:function()
{this._spectrumHelper.hide();this._discardElementUnderMouse();},_discardElementUnderMouse:function()
{if(this._elementUnderMouse)
this._elementUnderMouse.removeStyleClass("styles-panel-hovered");delete this._elementUnderMouse;},_mouseMovedOverElement:function(e)
@@ -391,8 +390,8 @@
{function wrappedCallback(){this._hasFreshContent=true;if(callback)
callback();delete this._hasFreshContent;}
this._stylesSidebarPane._refreshUpdate(null,true,wrappedCallback.bind(this));},__proto__:WebInspector.SidebarPane.prototype}
-WebInspector.StylePropertiesSection=function(parentPane,styleRule,editable,isInherited,isFirstSection)
-{WebInspector.PropertiesSection.call(this,"");this.element.className="styles-section matched-styles monospace"+(isFirstSection?" first-styles-section":"");this.propertiesElement.removeStyleClass("properties-tree");this._parentPane=parentPane;this.styleRule=styleRule;this.rule=this.styleRule.rule;this.editable=editable;this.isInherited=isInherited;if(styleRule.media){for(var i=styleRule.media.length-1;i>=0;--i){var media=styleRule.media[i];var mediaDataElement=this.titleElement.createChild("div","media");var mediaText;switch(media.source){case WebInspector.CSSMedia.Source.LINKED_SHEET:case WebInspector.CSSMedia.Source.INLINE_SHEET:mediaText="media=\""+media.text+"\"";break;case WebInspector.CSSMedia.Source.MEDIA_RULE:mediaText="@media "+media.text;break;case WebInspector.CSSMedia.Source.IMPORT_RULE:mediaText="@import "+media.text;break;}
+WebInspector.StylePropertiesSection=function(parentPane,styleRule,editable,isInherited)
+{WebInspector.PropertiesSection.call(this,"");this._parentPane=parentPane;this.styleRule=styleRule;this.rule=this.styleRule.rule;this.editable=editable;this.isInherited=isInherited;var extraClasses=(this.rule&&(this.rule.isUser||this.rule.isUserAgent)?" user-rule":"");this.element.className="styles-section matched-styles monospace"+extraClasses;this.propertiesElement.removeStyleClass("properties-tree");if(styleRule.media){for(var i=styleRule.media.length-1;i>=0;--i){var media=styleRule.media[i];var mediaDataElement=this.titleElement.createChild("div","media");var mediaText;switch(media.source){case WebInspector.CSSMedia.Source.LINKED_SHEET:case WebInspector.CSSMedia.Source.INLINE_SHEET:mediaText="media=\""+media.text+"\"";break;case WebInspector.CSSMedia.Source.MEDIA_RULE:mediaText="@media "+media.text;break;case WebInspector.CSSMedia.Source.IMPORT_RULE:mediaText="@import "+media.text;break;}
if(media.sourceURL){var refElement=mediaDataElement.createChild("div","subtitle");var rawLocation;var mediaHeader;if(media.range){mediaHeader=media.header();if(mediaHeader){var lineNumber=media.lineNumberInSource();var columnNumber=media.columnNumberInSource();console.assert(typeof lineNumber!=="undefined"&&typeof columnNumber!=="undefined");rawLocation=new WebInspector.CSSLocation(media.sourceURL,lineNumber,columnNumber);}}
var anchor;if(rawLocation)
anchor=this._parentPane._linkifier.linkifyCSSLocation(mediaHeader.id,rawLocation);else{anchor=WebInspector.linkifyResourceAsNode(media.sourceURL,undefined,"subtitle",media.sourceURL);}
@@ -402,7 +401,7 @@
this.editable=false;else{if(this.rule.id)
this.navigable=!!this.rule.resourceURL();}
this.titleElement.addStyleClass("styles-selector");}
-this._usedProperties=styleRule.usedProperties;this._selectorRefElement=document.createElement("div");this._selectorRefElement.className="subtitle";this._selectorRefElement.appendChild(this._createRuleOriginNode());selectorContainer.insertBefore(this._selectorRefElement,selectorContainer.firstChild);this.titleElement.appendChild(selectorContainer);this._selectorContainer=selectorContainer;if(isInherited)
+this._usedProperties=styleRule.usedProperties;this._selectorRefElement=document.createElement("div");this._selectorRefElement.className="subtitle";this._updateRuleOrigin();selectorContainer.insertBefore(this._selectorRefElement,selectorContainer.firstChild);this.titleElement.appendChild(selectorContainer);this._selectorContainer=selectorContainer;if(isInherited)
this.element.addStyleClass("show-inherited");if(this.navigable)
this.element.addStyleClass("navigable");if(!this.editable)
this.element.addStyleClass("read-only");}
@@ -439,9 +438,10 @@
{var rule=this.styleRule.rule;if(!rule)
return;var matchingSelectors=rule.matchingSelectors;if(this.noAffect||matchingSelectors)
this._selectorElement.className="selector";if(!matchingSelectors)
-return;var selectors=rule.selectors;var fragment=document.createDocumentFragment();var currentMatch=0;for(var i=0,lastSelectorIndex=selectors.length-1;i<=lastSelectorIndex;++i){var selectorNode;var textNode=document.createTextNode(selectors[i]);if(matchingSelectors[currentMatch]===i){++currentMatch;selectorNode=document.createElement("span");selectorNode.className="selector-matches";selectorNode.appendChild(textNode);}else
-selectorNode=textNode;fragment.appendChild(selectorNode);if(i!==lastSelectorIndex)
-fragment.appendChild(document.createTextNode(", "));}
+return;var selectors=rule.selectors;var fragment=document.createDocumentFragment();var currentMatch=0;for(var i=0;i<selectors.length;++i){if(i)
+fragment.appendChild(document.createTextNode(", "));var isSelectorMatching=matchingSelectors[currentMatch]===i;if(isSelectorMatching)
+++currentMatch;var rawLocation=new WebInspector.CSSLocation(rule.sourceURL,rule.lineNumberInSource(i),rule.columnNumberInSource(i));var matchingSelectorClass=isSelectorMatching?" selector-matches":"";var selectorElement=document.createElement("span");selectorElement.className="simple-selector"+matchingSelectorClass;if(rule.id)
+selectorElement._selectorIndex=i;selectorElement.textContent=selectors[i].value;fragment.appendChild(selectorElement);}
this._selectorElement.removeChildren();this._selectorElement.appendChild(fragment);},_checkWillCancelEditing:function()
{var willCauseCancelEditing=this._willCauseCancelEditing;delete this._willCauseCancelEditing;return willCauseCancelEditing;},_handleSelectorContainerClick:function(event)
{if(this._checkWillCancelEditing()||!this.editable)
@@ -450,8 +450,8 @@
{var style=this.styleRule.style;var property=style.newBlankProperty(index);var item=new WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,style,property,false,false,false);index=property.index;this.propertiesTreeOutline.insertChild(item,index);item.listItemElement.textContent="";item._newProperty=true;item.updateTitle();return item;},_createRuleOriginNode:function()
{function linkifyUncopyable(url,line)
{var link=WebInspector.linkifyResourceAsNode(url,line,"",url+":"+(line+1));link.preferredPanel="sources";link.classList.add("webkit-html-resource-link");link.setAttribute("data-uncopyable",link.textContent);link.textContent="";return link;}
-if(this.styleRule.sourceURL)
-return this._parentPane._linkifier.linkifyCSSLocation(this.rule.id.styleSheetId,this.rule.rawLocation)||linkifyUncopyable(this.styleRule.sourceURL,this.rule.lineNumberInSource());if(!this.rule)
+if(this.styleRule.sourceURL){var firstMatchingIndex=this.styleRule.rule.matchingSelectors&&this.rule.matchingSelectors.length?this.rule.matchingSelectors[0]:0;var matchingSelectorLocation=new WebInspector.CSSLocation(this.styleRule.sourceURL,this.rule.lineNumberInSource(firstMatchingIndex),this.rule.columnNumberInSource(firstMatchingIndex));return this._parentPane._linkifier.linkifyCSSLocation(this.rule.id.styleSheetId,matchingSelectorLocation)||linkifyUncopyable(this.styleRule.sourceURL,this.rule.lineNumberInSource());}
+if(!this.rule)
return document.createTextNode("");if(this.rule.isUserAgent)
return document.createTextNode(WebInspector.UIString("user agent stylesheet"));if(this.rule.isUser)
return document.createTextNode(WebInspector.UIString("user stylesheet"));if(this.rule.isViaInspector)
@@ -462,7 +462,9 @@
return;if(this._checkWillCancelEditing())
return;if(event.target.hasStyleClass("header")||this.element.hasStyleClass("read-only")||event.target.enclosingNodeOrSelfWithClass("media")){event.consume();return;}
this.expand();this.addNewBlankProperty().startEditing();},_handleSelectorClick:function(event)
-{this._startEditingOnMouseEvent();event.consume(true);},_startEditingOnMouseEvent:function()
+{if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&this.navigable&&event.target.hasStyleClass("simple-selector")){var index=event.target._selectorIndex;var range=this.rule.selectors[index].range;var styleSheetHeader=WebInspector.cssModel.styleSheetHeaderForId(this.rule.id.styleSheetId);var uiLocation=styleSheetHeader.rawLocationToUILocation(this.rule.lineNumberInSource(index),this.rule.columnNumberInSource(index));if(uiLocation)
+WebInspector.panel("sources").showUILocation(uiLocation);return;}
+this._startEditingOnMouseEvent();event.consume(true);},_startEditingOnMouseEvent:function()
{if(!this.editable)
return;if(!this.rule&&this.propertiesTreeOutline.children.length===0){this.expand();this.addNewBlankProperty().startEditing();return;}
if(!this.rule)
@@ -477,15 +479,16 @@
return;previousSection.expand();previousSection.addNewBlankProperty().startEditing();}},editingSelectorCommitted:function(element,newContent,oldContent,context,moveDirection)
{if(newContent)
newContent=newContent.trim();if(newContent===oldContent){this._selectorElement.textContent=newContent;return this._moveEditorFromSelector(moveDirection);}
-var selectedNode=this._parentPane.node;function successCallback(newRule,doesAffectSelectedNode)
-{if(!doesAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("no-affect");}else{delete this.noAffect;this.element.removeStyleClass("no-affect");}
-this.rule=newRule;this.styleRule={section:this,style:newRule.style,selectorText:newRule.selectorText,media:newRule.media,sourceURL:newRule.resourceURL(),rule:newRule};this._parentPane.update(selectedNode);finishOperationAndMoveEditor.call(this,moveDirection);}
+var selectedNode=this._parentPane.node;function successCallback(newRule)
+{var doesAffectSelectedNode=newRule.matchingSelectors.length>0;if(!doesAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("no-affect");}else{delete this.noAffect;this.element.removeStyleClass("no-affect");}
+this.rule=newRule;this.styleRule={section:this,style:newRule.style,selectorText:newRule.selectorText,media:newRule.media,sourceURL:newRule.resourceURL(),rule:newRule};this._parentPane.update(selectedNode);this._updateRuleOrigin();finishOperationAndMoveEditor.call(this,moveDirection);}
function finishOperationAndMoveEditor(direction)
{delete this._parentPane._userOperation;this._moveEditorFromSelector(direction);}
-this._parentPane._userOperation=true;WebInspector.cssModel.setRuleSelector(this.rule.id,selectedNode?selectedNode.id:0,newContent,successCallback.bind(this),finishOperationAndMoveEditor.bind(this,moveDirection));},editingSelectorCancelled:function()
+this._parentPane._userOperation=true;WebInspector.cssModel.setRuleSelector(this.rule.id,selectedNode?selectedNode.id:0,newContent,successCallback.bind(this),finishOperationAndMoveEditor.bind(this,moveDirection));},_updateRuleOrigin:function()
+{this._selectorRefElement.removeChildren();this._selectorRefElement.appendChild(this._createRuleOriginNode());},editingSelectorCancelled:function()
{this._markSelectorMatches();},__proto__:WebInspector.PropertiesSection.prototype}
WebInspector.ComputedStylePropertiesSection=function(stylesPane,styleRule,usedProperties)
-{WebInspector.PropertiesSection.call(this,"");this.headerElement.addStyleClass("hidden");this.element.className="styles-section monospace first-styles-section read-only computed-style";this._stylesPane=stylesPane;this.styleRule=styleRule;this._usedProperties=usedProperties;this._alwaysShowComputedProperties={"display":true,"height":true,"width":true};this.computedStyle=true;this._propertyTreeElements={};this._expandedPropertyNames={};}
+{WebInspector.PropertiesSection.call(this,"");this.headerElement.addStyleClass("hidden");this.element.className="styles-section monospace read-only computed-style";this._stylesPane=stylesPane;this.styleRule=styleRule;this._usedProperties=usedProperties;this._alwaysShowComputedProperties={"display":true,"height":true,"width":true};this.computedStyle=true;this._propertyTreeElements={};this._expandedPropertyNames={};}
WebInspector.ComputedStylePropertiesSection.prototype={collapse:function(dontRememberState)
{},_isPropertyInherited:function(propertyName)
{var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(propertyName);return!(canonicalName in this._usedProperties)&&!(canonicalName in this._alwaysShowComputedProperties);},update:function()
@@ -506,15 +509,15 @@
for(var name in this._expandedPropertyNames){if(name in this._propertyTreeElements)
this._propertyTreeElements[name].expand();}},__proto__:WebInspector.PropertiesSection.prototype}
WebInspector.BlankStylePropertiesSection=function(stylesPane,defaultSelectorText)
-{WebInspector.StylePropertiesSection.call(this,stylesPane,{selectorText:defaultSelectorText,rule:{isViaInspector:true}},true,false,false);this.element.addStyleClass("blank-section");}
+{WebInspector.StylePropertiesSection.call(this,stylesPane,{selectorText:defaultSelectorText,rule:{isViaInspector:true}},true,false);this.element.addStyleClass("blank-section");}
WebInspector.BlankStylePropertiesSection.prototype={get isBlank()
{return!this._normal;},expand:function()
{if(!this.isBlank)
WebInspector.StylePropertiesSection.prototype.expand.call(this);},editingSelectorCommitted:function(element,newContent,oldContent,context,moveDirection)
{if(!this.isBlank){WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted.call(this,element,newContent,oldContent,context,moveDirection);return;}
-function successCallback(newRule,doesSelectorAffectSelectedNode)
-{var styleRule={section:this,style:newRule.style,selectorText:newRule.selectorText,sourceURL:newRule.resourceURL(),rule:newRule};this.makeNormal(styleRule);if(!doesSelectorAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("no-affect");}
-this._selectorRefElement.removeChildren();this._selectorRefElement.appendChild(this._createRuleOriginNode());this.expand();if(this.element.parentElement)
+function successCallback(newRule)
+{var doesSelectorAffectSelectedNode=newRule.matchingSelectors.length>0;var styleRule={section:this,style:newRule.style,selectorText:newRule.selectorText,sourceURL:newRule.resourceURL(),rule:newRule};this.makeNormal(styleRule);if(!doesSelectorAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("no-affect");}
+this._updateRuleOrigin();this.expand();if(this.element.parentElement)
this._moveEditorFromSelector(moveDirection);this._markSelectorMatches();delete this._parentPane._userOperation;}
if(newContent)
newContent=newContent.trim();this._parentPane._userOperation=true;WebInspector.cssModel.addRule(this.pane.node.id,newContent,successCallback.bind(this),this.editingSelectorCancelled.bind(this));},editingSelectorCancelled:function()
@@ -633,7 +636,7 @@
if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&this.section().navigable){this._navigateToSource(event.target);return;}
this.startEditing(event.target);},_navigateToSource:function(element)
{console.assert(this.section().navigable);var propertyNameClicked=element===this.nameElement;var uiLocation=this.property.uiLocation(propertyNameClicked);if(!uiLocation)
-return;WebInspector.showPanel("sources").showUILocation(uiLocation);},_isNameElement:function(element)
+return;WebInspector.panel("sources").showUILocation(uiLocation);},_isNameElement:function(element)
{return element.enclosingNodeOrSelfWithClass("webkit-css-property")===this.nameElement;},_isValueElement:function(element)
{return!!element.enclosingNodeOrSelfWithClass("value");},startEditing:function(selectElement)
{if(this.parent.isShorthand)
@@ -760,21 +763,22 @@
return false;word=word.toLowerCase();return this._cssCompletions.keySet().hasOwnProperty(word);},_buildPropertyCompletions:function(proxyElement,wordRange,force,completionsReadyCallback)
{var prefix=wordRange.toString().toLowerCase();if(!prefix&&!force&&(this._isEditingName||proxyElement.textContent.length)){completionsReadyCallback([]);return;}
var results=this._cssCompletions.startsWith(prefix);var selectedIndex=this._cssCompletions.mostUsedOf(results);completionsReadyCallback(results,selectedIndex);},__proto__:WebInspector.TextPrompt.prototype};WebInspector.ElementsPanel=function()
-{WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("breadcrumbList.css");this.registerRequiredCSS("elementsPanel.css");this.registerRequiredCSS("textPrompt.css");this.setHideOnDetach();const initialSidebarWidth=325;const minimumContentWidthPercent=0.34;const initialSidebarHeight=325;const minimumContentHeightPercent=0.34;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialSidebarWidth,initialSidebarHeight);this.splitView.setSidebarElementConstraints(Preferences.minElementsSidebarWidth,Preferences.minElementsSidebarHeight);this.splitView.setMainElementConstraints(minimumContentWidthPercent,minimumContentHeightPercent);this.splitView.addEventListener(WebInspector.SidebarView.EventTypes.Resized,this._updateTreeOutlineVisibleWidth.bind(this));this.contentElement=this.splitView.mainElement;this.contentElement.id="elements-content";this.contentElement.addStyleClass("outline-disclosure");this.contentElement.addStyleClass("source-code");if(!WebInspector.settings.domWordWrap.get())
-this.contentElement.classList.add("nowrap");WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this));this.contentElement.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);this.splitView.sidebarElement.addEventListener("contextmenu",this._sidebarContextMenuEventFired.bind(this),false);this.treeOutline=new WebInspector.ElementsTreeOutline(true,true,this._populateContextMenu.bind(this),this._setPseudoClassForNodeId.bind(this));this.treeOutline.wireToDomAgent();this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedNodeChanged,this);this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated,this._updateBreadcrumbIfNeeded,this);this.crumbsElement=document.createElement("div");this.crumbsElement.className="crumbs";this.crumbsElement.addEventListener("mousemove",this._mouseMovedInCrumbs.bind(this),false);this.crumbsElement.addEventListener("mouseout",this._mouseMovedOutOfCrumbs.bind(this),false);this.sidebarPanes={};this.sidebarPanes.platformFonts=new WebInspector.PlatformFontsSidebarPane();this.sidebarPanes.computedStyle=new WebInspector.ComputedStyleSidebarPane();this.sidebarPanes.styles=new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle,this._setPseudoClassForNodeId.bind(this));this.sidebarPanes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPanes.properties=new WebInspector.PropertiesSidebarPane();this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.eventListeners=new WebInspector.EventListenersSidebarPane();this.sidebarPanes.styles.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateStyles.bind(this,false));this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateMetrics.bind(this));this.sidebarPanes.platformFonts.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updatePlatformFonts.bind(this));this.sidebarPanes.properties.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateProperties.bind(this));this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateEventListeners.bind(this));this.sidebarPanes.styles.addEventListener("style edited",this._stylesPaneEdited,this);this.sidebarPanes.styles.addEventListener("style property toggled",this._stylesPaneEdited,this);this.sidebarPanes.metrics.addEventListener("metrics edited",this._metricsPaneEdited,this);WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._popoverHelper=new WebInspector.PopoverHelper(this.element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this._popoverHelper.setTimeout(0);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated,this._documentUpdatedEvent,this);WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));if(WebInspector.domAgent.existingDocument())
+{WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("breadcrumbList.css");this.registerRequiredCSS("elementsPanel.css");this.registerRequiredCSS("textPrompt.css");this.setHideOnDetach();const initialSidebarWidth=325;const minimumContentWidthPercent=0.34;const initialSidebarHeight=325;const minimumContentHeightPercent=0.34;this.createSidebarView(this.element,WebInspector.SidebarView.SidebarPosition.End,initialSidebarWidth,initialSidebarHeight);this.splitView.sidebarElement.addStyleClass("vbox");this.splitView.setSidebarElementConstraints(Preferences.minElementsSidebarWidth,Preferences.minElementsSidebarHeight);this.splitView.setMainElementConstraints(minimumContentWidthPercent,minimumContentHeightPercent);this.splitView.addEventListener(WebInspector.SidebarView.EventTypes.Resized,this._updateTreeOutlineVisibleWidth.bind(this));var stackElement=this.splitView.mainElement;stackElement.addStyleClass("vbox");this.contentElement=stackElement.createChild("div");this.contentElement.id="elements-content";this.contentElement.addStyleClass("outline-disclosure");this.contentElement.addStyleClass("source-code");if(!WebInspector.settings.domWordWrap.get())
+this.contentElement.classList.add("nowrap");WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this));this.contentElement.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);this.splitView.sidebarElement.addEventListener("contextmenu",this._sidebarContextMenuEventFired.bind(this),false);this.treeOutline=new WebInspector.ElementsTreeOutline(true,true,this._populateContextMenu.bind(this),this._setPseudoClassForNodeId.bind(this));this.treeOutline.wireToDomAgent();this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedNodeChanged,this);this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.ElementsTreeUpdated,this._updateBreadcrumbIfNeeded,this);var crumbsContainer=stackElement.createChild("div");crumbsContainer.id="elements-crumbs";this.crumbsElement=crumbsContainer.createChild("div","crumbs");this.crumbsElement.addEventListener("mousemove",this._mouseMovedInCrumbs.bind(this),false);this.crumbsElement.addEventListener("mouseout",this._mouseMovedOutOfCrumbs.bind(this),false);this.sidebarPanes={};this.sidebarPanes.platformFonts=new WebInspector.PlatformFontsSidebarPane();this.sidebarPanes.computedStyle=new WebInspector.ComputedStyleSidebarPane();this.sidebarPanes.styles=new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle,this._setPseudoClassForNodeId.bind(this));this.sidebarPanes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPanes.properties=new WebInspector.PropertiesSidebarPane();this.sidebarPanes.domBreakpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.eventListeners=new WebInspector.EventListenersSidebarPane();this.sidebarPanes.styles.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateStyles.bind(this,false));this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateMetrics.bind(this));this.sidebarPanes.platformFonts.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updatePlatformFonts.bind(this));this.sidebarPanes.properties.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateProperties.bind(this));this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateEventListeners.bind(this));this.sidebarPanes.styles.addEventListener("style edited",this._stylesPaneEdited,this);this.sidebarPanes.styles.addEventListener("style property toggled",this._stylesPaneEdited,this);this.sidebarPanes.metrics.addEventListener("metrics edited",this._metricsPaneEdited,this);this._extensionSidebarPanes=[];WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(this));this._dockSideChanged();this._popoverHelper=new WebInspector.PopoverHelper(this.element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this._popoverHelper.setTimeout(0);WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated,this._documentUpdatedEvent,this);WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));if(WebInspector.domAgent.existingDocument())
this._documentUpdated(WebInspector.domAgent.existingDocument());WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this._updateSidebars,this);}
WebInspector.ElementsPanel.prototype={_updateTreeOutlineVisibleWidth:function()
{if(!this.treeOutline)
return;var width=this.splitView.element.offsetWidth;if(this.splitView.isVertical())
-width-=this.splitView.sidebarWidth();this.treeOutline.setVisibleWidth(width);},get statusBarItems()
-{return[this.crumbsElement];},defaultFocusedElement:function()
+width-=this.splitView.sidebarWidth();this.treeOutline.setVisibleWidth(width);this.updateBreadcrumbSizes();},defaultFocusedElement:function()
{return this.treeOutline.element;},statusBarResized:function()
{this.updateBreadcrumbSizes();},wasShown:function()
{if(this.treeOutline.element.parentElement!==this.contentElement)
this.contentElement.appendChild(this.treeOutline.element);WebInspector.Panel.prototype.wasShown.call(this);this.updateBreadcrumb();this.treeOutline.updateSelection();this.treeOutline.setVisible(true);if(!this.treeOutline.rootDOMNode)
WebInspector.domAgent.requestDocument();},willHide:function()
{WebInspector.domAgent.hideDOMNodeHighlight();this.treeOutline.setVisible(false);this._popoverHelper.hidePopover();this.contentElement.removeChild(this.treeOutline.element);WebInspector.Panel.prototype.willHide.call(this);},onResize:function()
-{this.treeOutline.updateSelection();this.updateBreadcrumbSizes();},_setPseudoClassForNodeId:function(nodeId,pseudoClass,enable)
+{this.treeOutline.updateSelection();this.updateBreadcrumbSizes();},createView:function(id)
+{if(!this._overridesView)
+this._overridesView=new WebInspector.OverridesView();return this._overridesView;},_setPseudoClassForNodeId:function(nodeId,pseudoClass,enable)
{var node=WebInspector.domAgent.nodeForId(nodeId);if(!node)
return;var pseudoClasses=node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName);if(enable){pseudoClasses=pseudoClasses||[];if(pseudoClasses.indexOf(pseudoClass)>=0)
return;pseudoClasses.push(pseudoClass);node.setUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.PropertyName,pseudoClasses);}else{if(!pseudoClasses||pseudoClasses.indexOf(pseudoClass)<0)
@@ -872,12 +876,12 @@
panel.selectDOMNode(crumb.representedObject,true);event.preventDefault();}
for(var current=this.selectedDOMNode();current;current=current.parentNode){if(current.nodeType()===Node.DOCUMENT_NODE)
continue;crumb=document.createElement("span");crumb.className="crumb";crumb.representedObject=current;crumb.addEventListener("mousedown",selectCrumbFunction,false);var crumbTitle="";switch(current.nodeType()){case Node.ELEMENT_NODE:if(current.pseudoType())
-crumbTitle=":"+current.pseudoType();else
+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="<!DOCTYPE>";break;default:crumbTitle=current.nodeNameInCorrectCase();}
if(!crumb.childNodes.length){var nameElement=document.createElement("span");nameElement.textContent=crumbTitle;crumb.appendChild(nameElement);crumb.title=crumbTitle;}
if(current===this.selectedDOMNode())
crumb.addStyleClass("selected");if(!crumbs.childNodes.length)
-crumb.addStyleClass("end");crumbs.appendChild(crumb);}
+crumb.addStyleClass("end");crumbs.insertBefore(crumb,crumbs.firstChild);}
if(crumbs.hasChildNodes())
crumbs.lastChild.addStyleClass("start");this.updateBreadcrumbSizes();},updateBreadcrumbSizes:function(focusedCrumb)
{if(!this.isShowing())
@@ -888,10 +892,8 @@
focusedIndex=i;if(crumb!==crumbs.lastChild)
crumb.removeStyleClass("start");if(crumb!==crumbs.firstChild)
crumb.removeStyleClass("end");crumb.removeStyleClass("compact");crumb.removeStyleClass("collapsed");crumb.removeStyleClass("hidden");crumb=crumb.nextSibling;++i;}
-crumbs.firstChild.addStyleClass("end");crumbs.lastChild.addStyleClass("start");var rightPadding=20;var crumbsTotalOffsetLeft=crumbs.totalOffsetLeft();var windowInnerWidth=window.innerWidth;var errorWarningElement=document.getElementById("error-warning-count");if(!WebInspector.drawer.visible){if(errorWarningElement)
-rightPadding+=errorWarningElement.offsetWidth;rightPadding+=WebInspector.settingsController.statusBarItem.offsetWidth;}
-function crumbsAreSmallerThanContainer()
-{return(crumbsTotalOffsetLeft+crumbs.offsetWidth+rightPadding)<windowInnerWidth;}
+crumbs.firstChild.addStyleClass("end");crumbs.lastChild.addStyleClass("start");var contentElement=this.contentElement;function crumbsAreSmallerThanContainer()
+{const rightPadding=10;return crumbs.offsetWidth+rightPadding<contentElement.offsetWidth;}
if(crumbsAreSmallerThanContainer())
return;var BothSides=0;var AncestorSide=-1;var ChildSide=1;function makeCrumbsSmaller(shrinkingFunction,direction,significantCrumb)
{if(!significantCrumb)
@@ -973,12 +975,13 @@
{this.treeOutline.update();},_splitVertically:function(vertically)
{if(this.sidebarPaneView&&vertically===!this.splitView.isVertical())
return;if(this.sidebarPaneView)
-this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);var computedPane=new WebInspector.SidebarPane(WebInspector.UIString("Computed"));computedPane.element.addStyleClass("composite");computedPane.element.addStyleClass("fill");var expandComputed=computedPane.expand.bind(computedPane);computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement);computedPane.bodyElement.addStyleClass("metrics-and-computed");this.sidebarPanes.computedStyle.show(computedPane.bodyElement);this.sidebarPanes.computedStyle.setExpandCallback(expandComputed);this.sidebarPanes.platformFonts.show(computedPane.bodyElement);if(vertically){this.sidebarPanes.metrics.show(computedPane.bodyElement,this.sidebarPanes.computedStyle.element);this.sidebarPanes.metrics.setExpandCallback(expandComputed);this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var compositePane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());compositePane.element.addStyleClass("composite");compositePane.element.addStyleClass("fill");var expandComposite=compositePane.expand.bind(compositePane);var splitView=new WebInspector.SplitView(true,"StylesPaneSplitRatio",0.5);splitView.show(compositePane.bodyElement);this.sidebarPanes.styles.show(splitView.firstElement());splitView.firstElement().appendChild(this.sidebarPanes.styles.titleElement);this.sidebarPanes.styles.setExpandCallback(expandComposite);computedPane.show(splitView.secondElement());computedPane.setExpandCallback(expandComposite);this.sidebarPaneView.addPane(compositePane);this.sidebarPaneView.addPane(this.sidebarPanes.properties);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);}else{this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var stylesPane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());stylesPane.element.addStyleClass("composite");stylesPane.element.addStyleClass("fill");var expandStyles=stylesPane.expand.bind(stylesPane);stylesPane.bodyElement.addStyleClass("metrics-and-styles");this.sidebarPanes.styles.show(stylesPane.bodyElement);this.sidebarPanes.styles.setExpandCallback(expandStyles);this.sidebarPanes.metrics.setExpandCallback(expandStyles);stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);function showMetrics(pane,beforeElement)
+this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);var computedPane=new WebInspector.SidebarPane(WebInspector.UIString("Computed"));computedPane.element.addStyleClass("composite");computedPane.element.addStyleClass("fill");var expandComputed=computedPane.expand.bind(computedPane);computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement);computedPane.bodyElement.addStyleClass("metrics-and-computed");this.sidebarPanes.computedStyle.show(computedPane.bodyElement);this.sidebarPanes.computedStyle.setExpandCallback(expandComputed);this.sidebarPanes.platformFonts.show(computedPane.bodyElement);if(vertically){this.sidebarPanes.metrics.show(computedPane.bodyElement,this.sidebarPanes.computedStyle.element);this.sidebarPanes.metrics.setExpandCallback(expandComputed);this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var compositePane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());compositePane.element.addStyleClass("composite");compositePane.element.addStyleClass("fill");var expandComposite=compositePane.expand.bind(compositePane);var splitView=new WebInspector.SplitView(true,"StylesPaneSplitRatio",0.5);splitView.show(compositePane.bodyElement);this.sidebarPanes.styles.show(splitView.firstElement());splitView.firstElement().appendChild(this.sidebarPanes.styles.titleElement);this.sidebarPanes.styles.setExpandCallback(expandComposite);computedPane.show(splitView.secondElement());computedPane.setExpandCallback(expandComposite);this.sidebarPaneView.addPane(compositePane);this.sidebarPaneView.addPane(this.sidebarPanes.properties);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);this._extensionSidebarPanesContainer=this.sidebarPaneView;}else{this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var stylesPane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());stylesPane.element.addStyleClass("composite");stylesPane.element.addStyleClass("fill");var expandStyles=stylesPane.expand.bind(stylesPane);stylesPane.bodyElement.addStyleClass("metrics-and-styles");this.sidebarPanes.styles.show(stylesPane.bodyElement);this.sidebarPanes.styles.setExpandCallback(expandStyles);this.sidebarPanes.metrics.setExpandCallback(expandStyles);stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);function showMetrics(pane,beforeElement)
{this.sidebarPanes.metrics.show(pane.bodyElement,beforeElement);}
function tabSelected(event)
{var tabId=(event.data.tabId);if(tabId===computedPane.title())
showMetrics.call(this,computedPane,this.sidebarPanes.computedStyle.element);if(tabId===stylesPane.title())
showMetrics.call(this,stylesPane);}
-this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,tabSelected,this);showMetrics.call(this,stylesPane);this.sidebarPaneView.addPane(stylesPane);this.sidebarPaneView.addPane(computedPane);this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.properties);}
-this.sidebarPaneView.show(this.splitView.sidebarElement);this.sidebarPanes.styles.expand();},addExtensionSidebarPane:function(id,pane)
-{this.sidebarPanes[id]=pane;this.sidebarPaneView.addPane(pane);},__proto__:WebInspector.Panel.prototype}
+this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,tabSelected,this);showMetrics.call(this,stylesPane);this.sidebarPaneView.addPane(stylesPane);this.sidebarPaneView.addPane(computedPane);this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.properties);this._extensionSidebarPanesContainer=this.sidebarPaneView;}
+for(var i=0;i<this._extensionSidebarPanes.length;++i)
+this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);this.sidebarPaneView.show(this.splitView.sidebarElement);this.sidebarPanes.styles.expand();},addExtensionSidebarPane:function(id,pane)
+{this._extensionSidebarPanes.push(pane);this._extensionSidebarPanesContainer.addPane(pane);},__proto__:WebInspector.Panel.prototype}
« no previous file with comments | « chrome_linux64/resources/inspector/CodeMirrorTextEditor.js ('k') | chrome_linux64/resources/inspector/HeapSnapshotWorker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698