OLD | NEW |
1 WebInspector.CSSNamedFlowCollectionsView=function() | 1 WebInspector.CSSNamedFlowCollectionsView=function() |
2 {WebInspector.SidebarView.call(this,WebInspector.SidebarView.SidebarPosition.Sta
rt);this.registerRequiredCSS("cssNamedFlows.css");this._namedFlows={};this._cont
entNodes={};this._regionNodes={};this.element.addStyleClass("css-named-flow-coll
ections-view");this.element.addStyleClass("fill");this._statusElement=document.c
reateElement("span");this._statusElement.textContent=WebInspector.UIString("CSS
Named Flows");var sidebarHeader=this.firstElement().createChild("div","tabbed-pa
ne-header selected sidebar-header");var tab=sidebarHeader.createChild("div","tab
bed-pane-header-tab");tab.createChild("span","tabbed-pane-header-tab-title").tex
tContent=WebInspector.UIString("CSS Named Flows");this._sidebarContentElement=th
is.firstElement().createChild("div","sidebar-content outline-disclosure");this._
flowListElement=this._sidebarContentElement.createChild("ol");this._flowTree=new
TreeOutline(this._flowListElement);this._emptyElement=document.createElement("d
iv");this._emptyElement.addStyleClass("info");this._emptyElement.textContent=Web
Inspector.UIString("No CSS Named Flows");this._tabbedPane=new WebInspector.Tabbe
dPane();this._tabbedPane.closeableTabs=true;this._tabbedPane.show(this.secondEle
ment());} | 2 {WebInspector.SidebarView.call(this,WebInspector.SidebarView.SidebarPosition.Sta
rt);this.registerRequiredCSS("cssNamedFlows.css");this._namedFlows={};this._cont
entNodes={};this._regionNodes={};this.element.addStyleClass("css-named-flow-coll
ections-view");this.element.addStyleClass("fill");this._statusElement=document.c
reateElement("span");this._statusElement.textContent=WebInspector.UIString("CSS
Named Flows");var sidebarHeader=this.firstElement().createChild("div","tabbed-pa
ne-header selected sidebar-header");var tab=sidebarHeader.createChild("div","tab
bed-pane-header-tab");tab.createChild("span","tabbed-pane-header-tab-title").tex
tContent=WebInspector.UIString("CSS Named Flows");this._sidebarContentElement=th
is.firstElement().createChild("div","sidebar-content outline-disclosure");this._
flowListElement=this._sidebarContentElement.createChild("ol");this._flowTree=new
TreeOutline(this._flowListElement);this._emptyElement=document.createElement("d
iv");this._emptyElement.addStyleClass("info");this._emptyElement.textContent=Web
Inspector.UIString("No CSS Named Flows");this._tabbedPane=new WebInspector.Tabbe
dPane();this._tabbedPane.closeableTabs=true;this._tabbedPane.show(this.secondEle
ment());} |
3 WebInspector.CSSNamedFlowCollectionsView.prototype={showInDrawer:function() | 3 WebInspector.CSSNamedFlowCollectionsView.prototype={showInDrawer:function() |
4 {WebInspector.showViewInDrawer(this._statusElement,this);},reset:function() | 4 {WebInspector.inspectorView.showCloseableViewInDrawer("css-flows",WebInspector.U
IString("CSS Flows"),this);},reset:function() |
5 {if(!this._document) | 5 {if(!this._document) |
6 return;WebInspector.cssModel.getNamedFlowCollectionAsync(this._document.id,this.
_resetNamedFlows.bind(this));},_setDocument:function(document) | 6 return;WebInspector.cssModel.getNamedFlowCollectionAsync(this._document.id,this.
_resetNamedFlows.bind(this));},_setDocument:function(document) |
7 {this._document=document;this.reset();},_documentUpdated:function(event) | 7 {this._document=document;this.reset();},_documentUpdated:function(event) |
8 {var document=(event.data);this._setDocument(document);},_setSidebarHasContent:f
unction(hasContent) | 8 {var document=(event.data);this._setDocument(document);},_setSidebarHasContent:f
unction(hasContent) |
9 {if(hasContent){if(!this._emptyElement.parentNode) | 9 {if(hasContent){if(!this._emptyElement.parentNode) |
10 return;this._sidebarContentElement.removeChild(this._emptyElement);this._sidebar
ContentElement.appendChild(this._flowListElement);}else{if(!this._flowListElemen
t.parentNode) | 10 return;this._sidebarContentElement.removeChild(this._emptyElement);this._sidebar
ContentElement.appendChild(this._flowListElement);}else{if(!this._flowListElemen
t.parentNode) |
11 return;this._sidebarContentElement.removeChild(this._flowListElement);this._side
barContentElement.appendChild(this._emptyElement);}},_appendNamedFlow:function(f
low) | 11 return;this._sidebarContentElement.removeChild(this._flowListElement);this._side
barContentElement.appendChild(this._emptyElement);}},_appendNamedFlow:function(f
low) |
12 {var flowHash=this._hashNamedFlow(flow.documentNodeId,flow.name);var flowContain
er={flow:flow,flowHash:flowHash};for(var i=0;i<flow.content.length;++i) | 12 {var flowHash=this._hashNamedFlow(flow.documentNodeId,flow.name);var flowContain
er={flow:flow,flowHash:flowHash};for(var i=0;i<flow.content.length;++i) |
13 this._contentNodes[flow.content[i]]=flowHash;for(var i=0;i<flow.regions.length;+
+i) | 13 this._contentNodes[flow.content[i]]=flowHash;for(var i=0;i<flow.regions.length;+
+i) |
14 this._regionNodes[flow.regions[i].nodeId]=flowHash;var flowTreeItem=new WebInspe
ctor.FlowTreeElement(flowContainer);flowTreeItem.onselect=this._selectNamedFlowT
ab.bind(this,flowHash);flowContainer.flowTreeItem=flowTreeItem;this._namedFlows[
flowHash]=flowContainer;if(!this._flowTree.children.length) | 14 this._regionNodes[flow.regions[i].nodeId]=flowHash;var flowTreeItem=new WebInspe
ctor.FlowTreeElement(flowContainer);flowTreeItem.onselect=this._selectNamedFlowT
ab.bind(this,flowHash);flowContainer.flowTreeItem=flowTreeItem;this._namedFlows[
flowHash]=flowContainer;if(!this._flowTree.children.length) |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 return;platformFonts.sort(function(a,b){return b.glyphCount-a.glyphCount;});for(
var i=0;i<platformFonts.length;++i){var fontStatElement=this._fontStatsSection.c
reateChild("div","font-stats-item");var fontNameElement=fontStatElement.createCh
ild("span","font-name");fontNameElement.textContent=platformFonts[i].familyName;
var fontDelimeterElement=fontStatElement.createChild("span","delimeter");fontDel
imeterElement.textContent="\u2014";var fontUsageElement=fontStatElement.createCh
ild("span","font-usage");var usage=platformFonts[i].glyphCount;fontUsageElement.
textContent=usage===1?WebInspector.UIString("%d glyph",usage):WebInspector.UIStr
ing("%d glyphs",usage);}},__proto__:WebInspector.SidebarPane.prototype};WebInspe
ctor.PropertiesSidebarPane=function() | 213 return;platformFonts.sort(function(a,b){return b.glyphCount-a.glyphCount;});for(
var i=0;i<platformFonts.length;++i){var fontStatElement=this._fontStatsSection.c
reateChild("div","font-stats-item");var fontNameElement=fontStatElement.createCh
ild("span","font-name");fontNameElement.textContent=platformFonts[i].familyName;
var fontDelimeterElement=fontStatElement.createChild("span","delimeter");fontDel
imeterElement.textContent="\u2014";var fontUsageElement=fontStatElement.createCh
ild("span","font-usage");var usage=platformFonts[i].glyphCount;fontUsageElement.
textContent=usage===1?WebInspector.UIString("%d glyph",usage):WebInspector.UIStr
ing("%d glyphs",usage);}},__proto__:WebInspector.SidebarPane.prototype};WebInspe
ctor.PropertiesSidebarPane=function() |
214 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Properties"));} | 214 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Properties"));} |
215 WebInspector.PropertiesSidebarPane._objectGroupName="properties-sidebar-pane";We
bInspector.PropertiesSidebarPane.prototype={update:function(node) | 215 WebInspector.PropertiesSidebarPane._objectGroupName="properties-sidebar-pane";We
bInspector.PropertiesSidebarPane.prototype={update:function(node) |
216 {var body=this.bodyElement;if(!node){body.removeChildren();this.sections=[];retu
rn;} | 216 {var body=this.bodyElement;if(!node){body.removeChildren();this.sections=[];retu
rn;} |
217 WebInspector.RemoteObject.resolveNode(node,WebInspector.PropertiesSidebarPane._o
bjectGroupName,nodeResolved.bind(this));function nodeResolved(object) | 217 WebInspector.RemoteObject.resolveNode(node,WebInspector.PropertiesSidebarPane._o
bjectGroupName,nodeResolved.bind(this));function nodeResolved(object) |
218 {if(!object) | 218 {if(!object) |
219 return;function protoList() | 219 return;function protoList() |
220 {var proto=this;var result={};var counter=1;while(proto){result[counter++]=proto
;proto=proto.__proto__;} | 220 {var proto=this;var result={};var counter=1;while(proto){result[counter++]=proto
;proto=proto.__proto__;} |
221 return result;} | 221 return result;} |
222 object.callFunction(protoList,undefined,nodePrototypesReady.bind(this));object.r
elease();} | 222 object.callFunction(protoList,undefined,nodePrototypesReady.bind(this));object.r
elease();} |
223 function nodePrototypesReady(object) | 223 function nodePrototypesReady(object,wasThrown) |
224 {if(!object) | 224 {if(!object||wasThrown) |
225 return;object.getOwnProperties(fillSection.bind(this));} | 225 return;object.getOwnProperties(fillSection.bind(this));} |
226 function fillSection(prototypes) | 226 function fillSection(prototypes) |
227 {if(!prototypes) | 227 {if(!prototypes) |
228 return;var body=this.bodyElement;body.removeChildren();this.sections=[];for(var
i=0;i<prototypes.length;++i){if(!parseInt(prototypes[i].name,10)) | 228 return;var body=this.bodyElement;body.removeChildren();this.sections=[];for(var
i=0;i<prototypes.length;++i){if(!parseInt(prototypes[i].name,10)) |
229 continue;var prototype=prototypes[i].value;var title=prototype.description;if(ti
tle.match(/Prototype$/)) | 229 continue;var prototype=prototypes[i].value;var title=prototype.description;if(ti
tle.match(/Prototype$/)) |
230 title=title.replace(/Prototype$/,"");var section=new WebInspector.ObjectProperti
esSection(prototype,title);this.sections.push(section);body.appendChild(section.
element);}}},__proto__:WebInspector.SidebarPane.prototype};WebInspector.StylesSi
debarPane=function(computedStylePane,setPseudoClassCallback) | 230 title=title.replace(/Prototype$/,"");var section=new WebInspector.ObjectProperti
esSection(prototype,title);this.sections.push(section);body.appendChild(section.
element);}}},__proto__:WebInspector.SidebarPane.prototype};WebInspector.StylesSi
debarPane=function(computedStylePane,setPseudoClassCallback) |
231 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Styles"));this.settin
gsSelectElement=document.createElement("select");this.settingsSelectElement.clas
sName="select-settings";var option=document.createElement("option");option.value
=WebInspector.Color.Format.Original;option.label=WebInspector.UIString(WebInspec
tor.useLowerCaseMenuTitles()?"As authored":"As Authored");this.settingsSelectEle
ment.appendChild(option);option=document.createElement("option");option.value=We
bInspector.Color.Format.HEX;option.label=WebInspector.UIString("Hex Colors");thi
s.settingsSelectElement.appendChild(option);option=document.createElement("optio
n");option.value=WebInspector.Color.Format.RGB;option.label=WebInspector.UIStrin
g("RGB Colors");this.settingsSelectElement.appendChild(option);option=document.c
reateElement("option");option.value=WebInspector.Color.Format.HSL;option.label=W
ebInspector.UIString("HSL Colors");this.settingsSelectElement.appendChild(option
);var muteEventListener=function(event){event.consume(true);};this.settingsSelec
tElement.addEventListener("click",muteEventListener,true);this.settingsSelectEle
ment.addEventListener("change",this._changeSetting.bind(this),false);this._updat
eColorFormatFilter();this.titleElement.appendChild(this.settingsSelectElement);t
his._elementStateButton=document.createElement("button");this._elementStateButto
n.className="pane-title-button element-state";this._elementStateButton.title=Web
Inspector.UIString("Toggle Element State");this._elementStateButton.addEventList
ener("click",this._toggleElementStatePane.bind(this),false);this.titleElement.ap
pendChild(this._elementStateButton);var addButton=document.createElement("button
");addButton.className="pane-title-button add";addButton.id="add-style-button-te
st-id";addButton.title=WebInspector.UIString("New Style Rule");addButton.addEven
tListener("click",this._createNewRule.bind(this),false);this.titleElement.append
Child(addButton);this._computedStylePane=computedStylePane;computedStylePane._st
ylesSidebarPane=this;this._setPseudoClassCallback=setPseudoClassCallback;this.el
ement.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true
);WebInspector.settings.colorFormat.addChangeListener(this._colorFormatSettingCh
anged.bind(this));this._createElementStatePane();this.bodyElement.appendChild(th
is._elementStatePane);this._sectionsContainer=document.createElement("div");this
.bodyElement.appendChild(this._sectionsContainer);this._spectrumHelper=new WebIn
spector.SpectrumPopupHelper();this._linkifier=new WebInspector.Linkifier(new Web
Inspector.Linkifier.DefaultCSSFormatter());WebInspector.cssModel.addEventListene
r(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetOrMediaQuery
ResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyle
Model.Events.StyleSheetRemoved,this._styleSheetOrMediaQueryResultChanged,this);W
ebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleShe
etChanged,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.
addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this.
_styleSheetOrMediaQueryResultChanged,this);WebInspector.domAgent.addEventListene
r(WebInspector.DOMAgent.Events.AttrModified,this._attributeChanged,this);WebInsp
ector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved,this._a
ttributeChanged,this);WebInspector.settings.showUserAgentStyles.addChangeListene
r(this._showUserAgentStylesSettingChanged.bind(this));this.element.addEventListe
ner("mousemove",this._mouseMovedOverElement.bind(this),false);document.body.addE
ventListener("keydown",this._keyDown.bind(this),false);document.body.addEventLis
tener("keyup",this._keyUp.bind(this),false);} | 231 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Styles"));this.settin
gsSelectElement=document.createElement("select");this.settingsSelectElement.clas
sName="select-settings";var option=document.createElement("option");option.value
=WebInspector.Color.Format.Original;option.label=WebInspector.UIString(WebInspec
tor.useLowerCaseMenuTitles()?"As authored":"As Authored");this.settingsSelectEle
ment.appendChild(option);option=document.createElement("option");option.value=We
bInspector.Color.Format.HEX;option.label=WebInspector.UIString("Hex Colors");thi
s.settingsSelectElement.appendChild(option);option=document.createElement("optio
n");option.value=WebInspector.Color.Format.RGB;option.label=WebInspector.UIStrin
g("RGB Colors");this.settingsSelectElement.appendChild(option);option=document.c
reateElement("option");option.value=WebInspector.Color.Format.HSL;option.label=W
ebInspector.UIString("HSL Colors");this.settingsSelectElement.appendChild(option
);var muteEventListener=function(event){event.consume(true);};this.settingsSelec
tElement.addEventListener("click",muteEventListener,true);this.settingsSelectEle
ment.addEventListener("change",this._changeSetting.bind(this),false);this._updat
eColorFormatFilter();this.titleElement.appendChild(this.settingsSelectElement);t
his._elementStateButton=document.createElement("button");this._elementStateButto
n.className="pane-title-button element-state";this._elementStateButton.title=Web
Inspector.UIString("Toggle Element State");this._elementStateButton.addEventList
ener("click",this._toggleElementStatePane.bind(this),false);this.titleElement.ap
pendChild(this._elementStateButton);var addButton=document.createElement("button
");addButton.className="pane-title-button add";addButton.id="add-style-button-te
st-id";addButton.title=WebInspector.UIString("New Style Rule");addButton.addEven
tListener("click",this._createNewRule.bind(this),false);this.titleElement.append
Child(addButton);this._computedStylePane=computedStylePane;computedStylePane._st
ylesSidebarPane=this;this._setPseudoClassCallback=setPseudoClassCallback;this.el
ement.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true
);WebInspector.settings.colorFormat.addChangeListener(this._colorFormatSettingCh
anged.bind(this));this._createElementStatePane();this.bodyElement.appendChild(th
is._elementStatePane);this._sectionsContainer=document.createElement("div");this
.bodyElement.appendChild(this._sectionsContainer);this._spectrumHelper=new WebIn
spector.SpectrumPopupHelper();this._linkifier=new WebInspector.Linkifier(new Web
Inspector.Linkifier.DefaultCSSFormatter());WebInspector.cssModel.addEventListene
r(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetOrMediaQuery
ResultChanged,this);WebInspector.cssModel.addEventListener(WebInspector.CSSStyle
Model.Events.StyleSheetRemoved,this._styleSheetOrMediaQueryResultChanged,this);W
ebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleShe
etChanged,this._styleSheetOrMediaQueryResultChanged,this);WebInspector.cssModel.
addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this.
_styleSheetOrMediaQueryResultChanged,this);WebInspector.domAgent.addEventListene
r(WebInspector.DOMAgent.Events.AttrModified,this._attributeChanged,this);WebInsp
ector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved,this._a
ttributeChanged,this);WebInspector.settings.showUserAgentStyles.addChangeListene
r(this._showUserAgentStylesSettingChanged.bind(this));this.element.addStyleClass
("styles-pane");this.element.enableStyleClass("show-user-styles",WebInspector.se
ttings.showUserAgentStyles.get());this.element.addEventListener("mousemove",this
._mouseMovedOverElement.bind(this),false);document.body.addEventListener("keydow
n",this._keyDown.bind(this),false);document.body.addEventListener("keyup",this._
keyUp.bind(this),false);} |
232 WebInspector.StylesSidebarPane.PseudoIdNames=["","first-line","first-letter","be
fore","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-butt
on","-webkit-media-controls-mute-button","-webkit-media-controls-timeline","-web
kit-media-controls-timeline-container","-webkit-media-controls-volume-slider","-
webkit-media-controls-volume-slider-container","-webkit-media-controls-current-t
ime-display","-webkit-media-controls-time-remaining-display","-webkit-media-cont
rols-seek-back-button","-webkit-media-controls-seek-forward-button","-webkit-med
ia-controls-fullscreen-button","-webkit-media-controls-rewind-button","-webkit-m
edia-controls-return-to-realtime-button","-webkit-media-controls-toggle-closed-c
aptions-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.St
ylesSidebarPane.createExclamationMark=function(property) | 232 WebInspector.StylesSidebarPane.PseudoIdNames=["","first-line","first-letter","be
fore","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-butt
on","-webkit-media-controls-mute-button","-webkit-media-controls-timeline","-web
kit-media-controls-timeline-container","-webkit-media-controls-volume-slider","-
webkit-media-controls-volume-slider-container","-webkit-media-controls-current-t
ime-display","-webkit-media-controls-time-remaining-display","-webkit-media-cont
rols-seek-back-button","-webkit-media-controls-seek-forward-button","-webkit-med
ia-controls-fullscreen-button","-webkit-media-controls-rewind-button","-webkit-m
edia-controls-return-to-realtime-button","-webkit-media-controls-toggle-closed-c
aptions-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.St
ylesSidebarPane.createExclamationMark=function(property) |
233 {var exclamationElement=document.createElement("div");exclamationElement.classNa
me="exclamation-mark"+(WebInspector.StylesSidebarPane._ignoreErrorsForProperty(p
roperty)?"":" warning-icon-small");exclamationElement.title=WebInspector.CSSMeta
data.cssPropertiesMetainfo.keySet()[property.name.toLowerCase()]?WebInspector.UI
String("Invalid property value."):WebInspector.UIString("Unknown property name."
);return exclamationElement;} | 233 {var exclamationElement=document.createElement("div");exclamationElement.classNa
me="exclamation-mark"+(WebInspector.StylesSidebarPane._ignoreErrorsForProperty(p
roperty)?"":" warning-icon-small");exclamationElement.title=WebInspector.CSSMeta
data.cssPropertiesMetainfo.keySet()[property.name.toLowerCase()]?WebInspector.UI
String("Invalid property value."):WebInspector.UIString("Unknown property name."
);return exclamationElement;} |
234 WebInspector.StylesSidebarPane._colorFormat=function(color) | 234 WebInspector.StylesSidebarPane._colorFormat=function(color) |
235 {const cf=WebInspector.Color.Format;var format;var formatSetting=WebInspector.se
ttings.colorFormat.get();if(formatSetting===cf.Original) | 235 {const cf=WebInspector.Color.Format;var format;var formatSetting=WebInspector.se
ttings.colorFormat.get();if(formatSetting===cf.Original) |
236 format=cf.Original;else if(formatSetting===cf.RGB) | 236 format=cf.Original;else if(formatSetting===cf.RGB) |
237 format=(color.hasAlpha()?cf.RGBA:cf.RGB);else if(formatSetting===cf.HSL) | 237 format=(color.hasAlpha()?cf.RGBA:cf.RGB);else if(formatSetting===cf.HSL) |
238 format=(color.hasAlpha()?cf.HSLA:cf.HSL);else if(!color.hasAlpha()) | 238 format=(color.hasAlpha()?cf.HSLA:cf.HSL);else if(!color.hasAlpha()) |
239 format=(color.canBeShortHex()?cf.ShortHEX:cf.HEX);else | 239 format=(color.canBeShortHex()?cf.ShortHEX:cf.HEX);else |
240 format=cf.RGBA;return format;} | 240 format=cf.RGBA;return format;} |
241 WebInspector.StylesSidebarPane._ignoreErrorsForProperty=function(property){funct
ion hasUnknownVendorPrefix(string) | 241 WebInspector.StylesSidebarPane._ignoreErrorsForProperty=function(property){funct
ion hasUnknownVendorPrefix(string) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 {},_refreshStyleRules:function(sections,computedStyle) | 303 {},_refreshStyleRules:function(sections,computedStyle) |
304 {var nodeComputedStyle=computedStyle;var styleRules=[];for(var i=0;sections&&i<s
ections.length;++i){var section=sections[i];if(section.isBlank) | 304 {var nodeComputedStyle=computedStyle;var styleRules=[];for(var i=0;sections&&i<s
ections.length;++i){var section=sections[i];if(section.isBlank) |
305 continue;if(section.computedStyle) | 305 continue;if(section.computedStyle) |
306 section.styleRule.style=nodeComputedStyle;var styleRule={section:section,style:s
ection.styleRule.style,computedStyle:section.computedStyle,rule:section.rule,edi
table:!!(section.styleRule.style&§ion.styleRule.style.id),isAttribute:sectio
n.styleRule.isAttribute,isInherited:section.styleRule.isInherited,parentNode:sec
tion.styleRule.parentNode};styleRules.push(styleRule);} | 306 section.styleRule.style=nodeComputedStyle;var styleRule={section:section,style:s
ection.styleRule.style,computedStyle:section.computedStyle,rule:section.rule,edi
table:!!(section.styleRule.style&§ion.styleRule.style.id),isAttribute:sectio
n.styleRule.isAttribute,isInherited:section.styleRule.isInherited,parentNode:sec
tion.styleRule.parentNode};styleRules.push(styleRule);} |
307 return styleRules;},_rebuildStyleRules:function(node,styles) | 307 return styleRules;},_rebuildStyleRules:function(node,styles) |
308 {var nodeComputedStyle=styles.computedStyle;this.sections={};var styleRules=[];f
unction addAttributesStyle() | 308 {var nodeComputedStyle=styles.computedStyle;this.sections={};var styleRules=[];f
unction addAttributesStyle() |
309 {if(!styles.attributesStyle) | 309 {if(!styles.attributesStyle) |
310 return;var attrStyle={style:styles.attributesStyle,editable:false};attrStyle.sel
ectorText=node.nodeNameInCorrectCase()+"["+WebInspector.UIString("Attributes Sty
le")+"]";styleRules.push(attrStyle);} | 310 return;var attrStyle={style:styles.attributesStyle,editable:false};attrStyle.sel
ectorText=node.nodeNameInCorrectCase()+"["+WebInspector.UIString("Attributes Sty
le")+"]";styleRules.push(attrStyle);} |
311 styleRules.push({computedStyle:true,selectorText:"",style:nodeComputedStyle,edit
able:false});if(!!node.pseudoType()) | 311 styleRules.push({computedStyle:true,selectorText:"",style:nodeComputedStyle,edit
able:false});if(!!node.pseudoType()) |
312 styleRules.push({isStyleSeparator:true,isPlaceholder:true});if(styles.inlineStyl
e&&node.nodeType()===Node.ELEMENT_NODE){var inlineStyle={selectorText:"element.s
tyle",style:styles.inlineStyle,isAttribute:true};styleRules.push(inlineStyle);} | 312 styleRules.push({isStyleSeparator:true,isPlaceholder:true});if(styles.inlineStyl
e&&node.nodeType()===Node.ELEMENT_NODE){var inlineStyle={selectorText:"element.s
tyle",style:styles.inlineStyle,isAttribute:true};styleRules.push(inlineStyle);} |
313 var addedAttributesStyle;for(var i=styles.matchedCSSRules.length-1;i>=0;--i){var
rule=styles.matchedCSSRules[i];if(!WebInspector.settings.showUserAgentStyles.ge
t()&&(rule.isUser||rule.isUserAgent)) | 313 var addedAttributesStyle;for(var i=styles.matchedCSSRules.length-1;i>=0;--i){var
rule=styles.matchedCSSRules[i];if((rule.isUser||rule.isUserAgent)&&!addedAttrib
utesStyle){addedAttributesStyle=true;addAttributesStyle();} |
314 continue;if((rule.isUser||rule.isUserAgent)&&!addedAttributesStyle){addedAttribu
tesStyle=true;addAttributesStyle();} | |
315 styleRules.push({style:rule.style,selectorText:rule.selectorText,media:rule.medi
a,sourceURL:rule.resourceURL(),rule:rule,editable:!!(rule.style&&rule.style.id)}
);} | 314 styleRules.push({style:rule.style,selectorText:rule.selectorText,media:rule.medi
a,sourceURL:rule.resourceURL(),rule:rule,editable:!!(rule.style&&rule.style.id)}
);} |
316 if(!addedAttributesStyle) | 315 if(!addedAttributesStyle) |
317 addAttributesStyle();var parentNode=node.parentNode;function insertInheritedNode
Separator(node) | 316 addAttributesStyle();var parentNode=node.parentNode;function insertInheritedNode
Separator(node) |
318 {var entry={};entry.isStyleSeparator=true;entry.node=node;styleRules.push(entry)
;} | 317 {var entry={};entry.isStyleSeparator=true;entry.node=node;styleRules.push(entry)
;} |
319 for(var parentOrdinal=0;parentOrdinal<styles.inherited.length;++parentOrdinal){v
ar parentStyles=styles.inherited[parentOrdinal];var separatorInserted=false;if(p
arentStyles.inlineStyle){if(this._containsInherited(parentStyles.inlineStyle)){v
ar inlineStyle={selectorText:WebInspector.UIString("Style Attribute"),style:pare
ntStyles.inlineStyle,isAttribute:true,isInherited:true,parentNode:parentNode};if
(!separatorInserted){insertInheritedNodeSeparator(parentNode);separatorInserted=
true;} | 318 for(var parentOrdinal=0;parentOrdinal<styles.inherited.length;++parentOrdinal){v
ar parentStyles=styles.inherited[parentOrdinal];var separatorInserted=false;if(p
arentStyles.inlineStyle){if(this._containsInherited(parentStyles.inlineStyle)){v
ar inlineStyle={selectorText:WebInspector.UIString("Style Attribute"),style:pare
ntStyles.inlineStyle,isAttribute:true,isInherited:true,parentNode:parentNode};if
(!separatorInserted){insertInheritedNodeSeparator(parentNode);separatorInserted=
true;} |
320 styleRules.push(inlineStyle);}} | 319 styleRules.push(inlineStyle);}} |
321 for(var i=parentStyles.matchedCSSRules.length-1;i>=0;--i){var rulePayload=parent
Styles.matchedCSSRules[i];if(!this._containsInherited(rulePayload.style)) | 320 for(var i=parentStyles.matchedCSSRules.length-1;i>=0;--i){var rulePayload=parent
Styles.matchedCSSRules[i];if(!this._containsInherited(rulePayload.style)) |
322 continue;var rule=rulePayload;if(!WebInspector.settings.showUserAgentStyles.get(
)&&(rule.isUser||rule.isUserAgent)) | 321 continue;var rule=rulePayload;if(!separatorInserted){insertInheritedNodeSeparato
r(parentNode);separatorInserted=true;} |
323 continue;if(!separatorInserted){insertInheritedNodeSeparator(parentNode);separat
orInserted=true;} | |
324 styleRules.push({style:rule.style,selectorText:rule.selectorText,media:rule.medi
a,sourceURL:rule.resourceURL(),rule:rule,isInherited:true,parentNode:parentNode,
editable:!!(rule.style&&rule.style.id)});} | 322 styleRules.push({style:rule.style,selectorText:rule.selectorText,media:rule.medi
a,sourceURL:rule.resourceURL(),rule:rule,isInherited:true,parentNode:parentNode,
editable:!!(rule.style&&rule.style.id)});} |
325 parentNode=parentNode.parentNode;} | 323 parentNode=parentNode.parentNode;} |
326 return styleRules;},_markUsedProperties:function(styleRules,usedProperties) | 324 return styleRules;},_markUsedProperties:function(styleRules,usedProperties) |
327 {var foundImportantProperties={};var propertyToEffectiveRule={};var inheritedPro
pertyToNode={};for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];
if(styleRule.computedStyle||styleRule.isStyleSeparator) | 325 {var foundImportantProperties={};var propertyToEffectiveRule={};var inheritedPro
pertyToNode={};for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];
if(styleRule.computedStyle||styleRule.isStyleSeparator) |
328 continue;if(styleRule.section&&styleRule.section.noAffect) | 326 continue;if(styleRule.section&&styleRule.section.noAffect) |
329 continue;styleRule.usedProperties={};var style=styleRule.style;var allProperties
=style.allProperties;for(var j=0;j<allProperties.length;++j){var property=allPro
perties[j];if(!property.isLive||!property.parsedOk) | 327 continue;styleRule.usedProperties={};var style=styleRule.style;var allProperties
=style.allProperties;for(var j=0;j<allProperties.length;++j){var property=allPro
perties[j];if(!property.isLive||!property.parsedOk) |
330 continue;if(styleRule.isInherited&&!WebInspector.CSSMetadata.isPropertyInherited
(property.name)) | 328 continue;if(styleRule.isInherited&&!WebInspector.CSSMetadata.isPropertyInherited
(property.name)) |
331 continue;var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(proper
ty.name);if(foundImportantProperties.hasOwnProperty(canonicalName)) | 329 continue;var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(proper
ty.name);if(foundImportantProperties.hasOwnProperty(canonicalName)) |
332 continue;var isImportant=property.priority.length;if(!isImportant&&usedPropertie
s.hasOwnProperty(canonicalName)) | 330 continue;var isImportant=property.priority.length;if(!isImportant&&usedPropertie
s.hasOwnProperty(canonicalName)) |
333 continue;var isKnownProperty=propertyToEffectiveRule.hasOwnProperty(canonicalNam
e);if(!isKnownProperty&&styleRule.isInherited&&!inheritedPropertyToNode[canonica
lName]) | 331 continue;var isKnownProperty=propertyToEffectiveRule.hasOwnProperty(canonicalNam
e);if(!isKnownProperty&&styleRule.isInherited&&!inheritedPropertyToNode[canonica
lName]) |
334 inheritedPropertyToNode[canonicalName]=styleRule.parentNode;if(isImportant){if(s
tyleRule.isInherited&&isKnownProperty&&styleRule.parentNode!==inheritedPropertyT
oNode[canonicalName]) | 332 inheritedPropertyToNode[canonicalName]=styleRule.parentNode;if(isImportant){if(s
tyleRule.isInherited&&isKnownProperty&&styleRule.parentNode!==inheritedPropertyT
oNode[canonicalName]) |
335 continue;foundImportantProperties[canonicalName]=true;if(isKnownProperty) | 333 continue;foundImportantProperties[canonicalName]=true;if(isKnownProperty) |
336 delete propertyToEffectiveRule[canonicalName].usedProperties[canonicalName];} | 334 delete propertyToEffectiveRule[canonicalName].usedProperties[canonicalName];} |
337 styleRule.usedProperties[canonicalName]=true;usedProperties[canonicalName]=true;
propertyToEffectiveRule[canonicalName]=styleRule;}}},_refreshSectionsForStyleRul
es:function(styleRules,usedProperties,editedSection) | 335 styleRule.usedProperties[canonicalName]=true;usedProperties[canonicalName]=true;
propertyToEffectiveRule[canonicalName]=styleRule;}}},_refreshSectionsForStyleRul
es:function(styleRules,usedProperties,editedSection) |
338 {for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];var section=st
yleRule.section;if(styleRule.computedStyle){section._usedProperties=usedProperti
es;section.update();}else{section._usedProperties=styleRule.usedProperties;secti
on.update(section===editedSection);}}},_rebuildSectionsForStyleRules:function(st
yleRules,usedProperties,anchorElement) | 336 {for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i];var section=st
yleRule.section;if(styleRule.computedStyle){section._usedProperties=usedProperti
es;section.update();}else{section._usedProperties=styleRule.usedProperties;secti
on.update(section===editedSection);}}},_rebuildSectionsForStyleRules:function(st
yleRules,usedProperties,anchorElement) |
339 {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.class
Name="styles-sidebar-placeholder";this._sectionsContainer.insertBefore(separator
Element,anchorElement);continue;} | 337 {var sections=[];for(var i=0;i<styleRules.length;++i){var styleRule=styleRules[i
];if(styleRule.isStyleSeparator){var separatorElement=document.createElement("di
v");if(styleRule.isPlaceholder){separatorElement.className="styles-sidebar-place
holder";this._sectionsContainer.insertBefore(separatorElement,anchorElement);con
tinue;} |
340 separatorElement.className="sidebar-separator";if(styleRule.node){var link=WebIn
spector.DOMPresentationUtils.linkifyNodeReference(styleRule.node);separatorEleme
nt.appendChild(document.createTextNode(WebInspector.UIString("Inherited from")+"
"));separatorElement.appendChild(link);if(!sections.inheritedPropertiesSeparato
rElement) | 338 separatorElement.className="sidebar-separator";if(styleRule.node){var link=WebIn
spector.DOMPresentationUtils.linkifyNodeReference(styleRule.node);separatorEleme
nt.appendChild(document.createTextNode(WebInspector.UIString("Inherited from")+"
"));separatorElement.appendChild(link);if(!sections.inheritedPropertiesSeparato
rElement) |
341 sections.inheritedPropertiesSeparatorElement=separatorElement;}else if("pseudoId
"in styleRule){var pseudoName=WebInspector.StylesSidebarPane.PseudoIdNames[style
Rule.pseudoId];if(pseudoName) | 339 sections.inheritedPropertiesSeparatorElement=separatorElement;}else if("pseudoId
"in styleRule){var pseudoName=WebInspector.StylesSidebarPane.PseudoIdNames[style
Rule.pseudoId];if(pseudoName) |
342 separatorElement.textContent=WebInspector.UIString("Pseudo ::%s element",pseudoN
ame);else | 340 separatorElement.textContent=WebInspector.UIString("Pseudo ::%s element",pseudoN
ame);else |
343 separatorElement.textContent=WebInspector.UIString("Pseudo element");}else | 341 separatorElement.textContent=WebInspector.UIString("Pseudo element");}else |
344 separatorElement.textContent=styleRule.text;this._sectionsContainer.insertBefore
(separatorElement,anchorElement);lastWasSeparator=true;continue;} | 342 separatorElement.textContent=styleRule.text;this._sectionsContainer.insertBefore
(separatorElement,anchorElement);continue;} |
345 var computedStyle=styleRule.computedStyle;var editable=styleRule.editable;if(typ
eof editable==="undefined") | 343 var computedStyle=styleRule.computedStyle;var editable=styleRule.editable;if(typ
eof editable==="undefined") |
346 editable=true;if(computedStyle) | 344 editable=true;if(computedStyle) |
347 var section=new WebInspector.ComputedStylePropertiesSection(this,styleRule,usedP
roperties);else{var section=new WebInspector.StylePropertiesSection(this,styleRu
le,editable,styleRule.isInherited,lastWasSeparator);section._markSelectorMatches
();} | 345 var section=new WebInspector.ComputedStylePropertiesSection(this,styleRule,usedP
roperties);else{var section=new WebInspector.StylePropertiesSection(this,styleRu
le,editable,styleRule.isInherited);section._markSelectorMatches();} |
348 section.expanded=true;if(computedStyle){this._computedStylePane.bodyElement.appe
ndChild(section.element);lastWasSeparator=true;}else{this._sectionsContainer.ins
ertBefore(section.element,anchorElement);lastWasSeparator=false;} | 346 section.expanded=true;if(computedStyle) |
349 sections.push(section);} | 347 this._computedStylePane.bodyElement.appendChild(section.element);else |
| 348 this._sectionsContainer.insertBefore(section.element,anchorElement);sections.pus
h(section);} |
350 return sections;},_containsInherited:function(style) | 349 return sections;},_containsInherited:function(style) |
351 {var properties=style.allProperties;for(var i=0;i<properties.length;++i){var pro
perty=properties[i];if(property.isLive&&WebInspector.CSSMetadata.isPropertyInher
ited(property.name)) | 350 {var properties=style.allProperties;for(var i=0;i<properties.length;++i){var pro
perty=properties[i];if(property.isLive&&WebInspector.CSSMetadata.isPropertyInher
ited(property.name)) |
352 return true;} | 351 return true;} |
353 return false;},_colorFormatSettingChanged:function(event) | 352 return false;},_colorFormatSettingChanged:function(event) |
354 {this._updateColorFormatFilter();for(var pseudoId in this.sections){var sections
=this.sections[pseudoId];for(var i=0;i<sections.length;++i) | 353 {this._updateColorFormatFilter();for(var pseudoId in this.sections){var sections
=this.sections[pseudoId];for(var i=0;i<sections.length;++i) |
355 sections[i].update(true);}},_updateColorFormatFilter:function() | 354 sections[i].update(true);}},_updateColorFormatFilter:function() |
356 {var selectedIndex=0;var value=WebInspector.settings.colorFormat.get();var optio
ns=this.settingsSelectElement.options;for(var i=0;i<options.length;++i){if(optio
ns[i].value===value){selectedIndex=i;break;}} | 355 {var selectedIndex=0;var value=WebInspector.settings.colorFormat.get();var optio
ns=this.settingsSelectElement.options;for(var i=0;i<options.length;++i){if(optio
ns[i].value===value){selectedIndex=i;break;}} |
357 this.settingsSelectElement.selectedIndex=selectedIndex;},_changeSetting:function
(event) | 356 this.settingsSelectElement.selectedIndex=selectedIndex;},_changeSetting:function
(event) |
358 {var options=this.settingsSelectElement.options;var selectedOption=options[this.
settingsSelectElement.selectedIndex];WebInspector.settings.colorFormat.set(selec
tedOption.value);},_createNewRule:function(event) | 357 {var options=this.settingsSelectElement.options;var selectedOption=options[this.
settingsSelectElement.selectedIndex];WebInspector.settings.colorFormat.set(selec
tedOption.value);},_createNewRule:function(event) |
359 {event.consume();this.expand();this.addBlankSection().startEditingSelector();},a
ddBlankSection:function() | 358 {event.consume();this.expand();this.addBlankSection().startEditingSelector();},a
ddBlankSection:function() |
360 {var blankSection=new WebInspector.BlankStylePropertiesSection(this,this.node?th
is.node.appropriateSelectorFor(true):"");var elementStyleSection=this.sections[0
][1];this._sectionsContainer.insertBefore(blankSection.element,elementStyleSecti
on.element.nextSibling);this.sections[0].splice(2,0,blankSection);return blankSe
ction;},removeSection:function(section) | 359 {var blankSection=new WebInspector.BlankStylePropertiesSection(this,this.node?th
is.node.appropriateSelectorFor(true):"");var elementStyleSection=this.sections[0
][1];this._sectionsContainer.insertBefore(blankSection.element,elementStyleSecti
on.element.nextSibling);this.sections[0].splice(2,0,blankSection);return blankSe
ction;},removeSection:function(section) |
361 {for(var pseudoId in this.sections){var sections=this.sections[pseudoId];var ind
ex=sections.indexOf(section);if(index===-1) | 360 {for(var pseudoId in this.sections){var sections=this.sections[pseudoId];var ind
ex=sections.indexOf(section);if(index===-1) |
362 continue;sections.splice(index,1);section.element.remove();}},_toggleElementStat
ePane:function(event) | 361 continue;sections.splice(index,1);section.element.remove();}},_toggleElementStat
ePane:function(event) |
363 {event.consume();var buttonToggled=!this._elementStateButton.hasStyleClass("togg
led");if(buttonToggled) | 362 {event.consume();var buttonToggled=!this._elementStateButton.hasStyleClass("togg
led");if(buttonToggled) |
364 this.expand();this._elementStateButton.enableStyleClass("toggled",buttonToggled)
;this._elementStatePane.enableStyleClass("expanded",buttonToggled);},_createElem
entStatePane:function() | 363 this.expand();this._elementStateButton.enableStyleClass("toggled",buttonToggled)
;this._elementStatePane.enableStyleClass("expanded",buttonToggled);},_createElem
entStatePane:function() |
365 {this._elementStatePane=document.createElement("div");this._elementStatePane.cla
ssName="styles-element-state-pane source-code";var table=document.createElement(
"table");var inputs=[];this._elementStatePane.inputs=inputs;function clickListen
er(event) | 364 {this._elementStatePane=document.createElement("div");this._elementStatePane.cla
ssName="styles-element-state-pane source-code";var table=document.createElement(
"table");var inputs=[];this._elementStatePane.inputs=inputs;function clickListen
er(event) |
366 {var node=this._validateNode();if(!node) | 365 {var node=this._validateNode();if(!node) |
367 return;this._setPseudoClassCallback(node.id,event.target.state,event.target.chec
ked);} | 366 return;this._setPseudoClassCallback(node.id,event.target.state,event.target.chec
ked);} |
368 function createCheckbox(state) | 367 function createCheckbox(state) |
369 {var td=document.createElement("td");var label=document.createElement("label");v
ar input=document.createElement("input");input.type="checkbox";input.state=state
;input.addEventListener("click",clickListener.bind(this),false);inputs.push(inpu
t);label.appendChild(input);label.appendChild(document.createTextNode(":"+state)
);td.appendChild(label);return td;} | 368 {var td=document.createElement("td");var label=document.createElement("label");v
ar input=document.createElement("input");input.type="checkbox";input.state=state
;input.addEventListener("click",clickListener.bind(this),false);inputs.push(inpu
t);label.appendChild(input);label.appendChild(document.createTextNode(":"+state)
);td.appendChild(label);return td;} |
370 var tr=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"act
ive"));tr.appendChild(createCheckbox.call(this,"hover"));table.appendChild(tr);t
r=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"focus"))
;tr.appendChild(createCheckbox.call(this,"visited"));table.appendChild(tr);this.
_elementStatePane.appendChild(table);},_showUserAgentStylesSettingChanged:functi
on() | 369 var tr=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"act
ive"));tr.appendChild(createCheckbox.call(this,"hover"));table.appendChild(tr);t
r=document.createElement("tr");tr.appendChild(createCheckbox.call(this,"focus"))
;tr.appendChild(createCheckbox.call(this,"visited"));table.appendChild(tr);this.
_elementStatePane.appendChild(table);},_showUserAgentStylesSettingChanged:functi
on(event) |
371 {this._rebuildUpdate();},willHide:function() | 370 {var showStyles=(event.data);this.element.enableStyleClass("show-user-styles",sh
owStyles);},willHide:function() |
372 {this._spectrumHelper.hide();this._discardElementUnderMouse();},_discardElementU
nderMouse:function() | 371 {this._spectrumHelper.hide();this._discardElementUnderMouse();},_discardElementU
nderMouse:function() |
373 {if(this._elementUnderMouse) | 372 {if(this._elementUnderMouse) |
374 this._elementUnderMouse.removeStyleClass("styles-panel-hovered");delete this._el
ementUnderMouse;},_mouseMovedOverElement:function(e) | 373 this._elementUnderMouse.removeStyleClass("styles-panel-hovered");delete this._el
ementUnderMouse;},_mouseMovedOverElement:function(e) |
375 {if(this._elementUnderMouse&&e.target!==this._elementUnderMouse) | 374 {if(this._elementUnderMouse&&e.target!==this._elementUnderMouse) |
376 this._discardElementUnderMouse();this._elementUnderMouse=e.target;if(WebInspecto
r.KeyboardShortcut.eventHasCtrlOrMeta(e)) | 375 this._discardElementUnderMouse();this._elementUnderMouse=e.target;if(WebInspecto
r.KeyboardShortcut.eventHasCtrlOrMeta(e)) |
377 this._elementUnderMouse.addStyleClass("styles-panel-hovered");},_keyDown:functio
n(e) | 376 this._elementUnderMouse.addStyleClass("styles-panel-hovered");},_keyDown:functio
n(e) |
378 {if((!WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Ctrl.
code)||(WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Met
a.code)){if(this._elementUnderMouse) | 377 {if((!WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Ctrl.
code)||(WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Met
a.code)){if(this._elementUnderMouse) |
379 this._elementUnderMouse.addStyleClass("styles-panel-hovered");}},_keyUp:function
(e) | 378 this._elementUnderMouse.addStyleClass("styles-panel-hovered");}},_keyUp:function
(e) |
380 {if((!WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Ctrl.
code)||(WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Met
a.code)){this._discardElementUnderMouse();}},__proto__:WebInspector.SidebarPane.
prototype} | 379 {if((!WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Ctrl.
code)||(WebInspector.isMac()&&e.keyCode===WebInspector.KeyboardShortcut.Keys.Met
a.code)){this._discardElementUnderMouse();}},__proto__:WebInspector.SidebarPane.
prototype} |
381 WebInspector.ComputedStyleSidebarPane=function() | 380 WebInspector.ComputedStyleSidebarPane=function() |
382 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Computed Style"));var
showInheritedCheckbox=new WebInspector.Checkbox(WebInspector.UIString("Show inh
erited"),"sidebar-pane-subtitle");this.titleElement.appendChild(showInheritedChe
ckbox.element);if(WebInspector.settings.showInheritedComputedStyleProperties.get
()){this.bodyElement.addStyleClass("show-inherited");showInheritedCheckbox.check
ed=true;} | 381 {WebInspector.SidebarPane.call(this,WebInspector.UIString("Computed Style"));var
showInheritedCheckbox=new WebInspector.Checkbox(WebInspector.UIString("Show inh
erited"),"sidebar-pane-subtitle");this.titleElement.appendChild(showInheritedChe
ckbox.element);if(WebInspector.settings.showInheritedComputedStyleProperties.get
()){this.bodyElement.addStyleClass("show-inherited");showInheritedCheckbox.check
ed=true;} |
383 function showInheritedToggleFunction() | 382 function showInheritedToggleFunction() |
384 {WebInspector.settings.showInheritedComputedStyleProperties.set(showInheritedChe
ckbox.checked);if(WebInspector.settings.showInheritedComputedStyleProperties.get
()) | 383 {WebInspector.settings.showInheritedComputedStyleProperties.set(showInheritedChe
ckbox.checked);if(WebInspector.settings.showInheritedComputedStyleProperties.get
()) |
385 this.bodyElement.addStyleClass("show-inherited");else | 384 this.bodyElement.addStyleClass("show-inherited");else |
386 this.bodyElement.removeStyleClass("show-inherited");} | 385 this.bodyElement.removeStyleClass("show-inherited");} |
387 showInheritedCheckbox.addEventListener(showInheritedToggleFunction.bind(this));} | 386 showInheritedCheckbox.addEventListener(showInheritedToggleFunction.bind(this));} |
388 WebInspector.ComputedStyleSidebarPane.prototype={wasShown:function() | 387 WebInspector.ComputedStyleSidebarPane.prototype={wasShown:function() |
389 {WebInspector.SidebarPane.prototype.wasShown.call(this);if(!this._hasFreshConten
t) | 388 {WebInspector.SidebarPane.prototype.wasShown.call(this);if(!this._hasFreshConten
t) |
390 this.prepareContent();},prepareContent:function(callback) | 389 this.prepareContent();},prepareContent:function(callback) |
391 {function wrappedCallback(){this._hasFreshContent=true;if(callback) | 390 {function wrappedCallback(){this._hasFreshContent=true;if(callback) |
392 callback();delete this._hasFreshContent;} | 391 callback();delete this._hasFreshContent;} |
393 this._stylesSidebarPane._refreshUpdate(null,true,wrappedCallback.bind(this));},_
_proto__:WebInspector.SidebarPane.prototype} | 392 this._stylesSidebarPane._refreshUpdate(null,true,wrappedCallback.bind(this));},_
_proto__:WebInspector.SidebarPane.prototype} |
394 WebInspector.StylePropertiesSection=function(parentPane,styleRule,editable,isInh
erited,isFirstSection) | 393 WebInspector.StylePropertiesSection=function(parentPane,styleRule,editable,isInh
erited) |
395 {WebInspector.PropertiesSection.call(this,"");this.element.className="styles-sec
tion matched-styles monospace"+(isFirstSection?" first-styles-section":"");this.
propertiesElement.removeStyleClass("properties-tree");this._parentPane=parentPan
e;this.styleRule=styleRule;this.rule=this.styleRule.rule;this.editable=editable;
this.isInherited=isInherited;if(styleRule.media){for(var i=styleRule.media.lengt
h-1;i>=0;--i){var media=styleRule.media[i];var mediaDataElement=this.titleElemen
t.createChild("div","media");var mediaText;switch(media.source){case WebInspecto
r.CSSMedia.Source.LINKED_SHEET:case WebInspector.CSSMedia.Source.INLINE_SHEET:me
diaText="media=\""+media.text+"\"";break;case WebInspector.CSSMedia.Source.MEDIA
_RULE:mediaText="@media "+media.text;break;case WebInspector.CSSMedia.Source.IMP
ORT_RULE:mediaText="@import "+media.text;break;} | 394 {WebInspector.PropertiesSection.call(this,"");this._parentPane=parentPane;this.s
tyleRule=styleRule;this.rule=this.styleRule.rule;this.editable=editable;this.isI
nherited=isInherited;var extraClasses=(this.rule&&(this.rule.isUser||this.rule.i
sUserAgent)?" user-rule":"");this.element.className="styles-section matched-styl
es monospace"+extraClasses;this.propertiesElement.removeStyleClass("properties-t
ree");if(styleRule.media){for(var i=styleRule.media.length-1;i>=0;--i){var media
=styleRule.media[i];var mediaDataElement=this.titleElement.createChild("div","me
dia");var mediaText;switch(media.source){case WebInspector.CSSMedia.Source.LINKE
D_SHEET:case WebInspector.CSSMedia.Source.INLINE_SHEET:mediaText="media=\""+medi
a.text+"\"";break;case WebInspector.CSSMedia.Source.MEDIA_RULE:mediaText="@media
"+media.text;break;case WebInspector.CSSMedia.Source.IMPORT_RULE:mediaText="@im
port "+media.text;break;} |
396 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.co
lumnNumberInSource();console.assert(typeof lineNumber!=="undefined"&&typeof colu
mnNumber!=="undefined");rawLocation=new WebInspector.CSSLocation(media.sourceURL
,lineNumber,columnNumber);}} | 395 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.co
lumnNumberInSource();console.assert(typeof lineNumber!=="undefined"&&typeof colu
mnNumber!=="undefined");rawLocation=new WebInspector.CSSLocation(media.sourceURL
,lineNumber,columnNumber);}} |
397 var anchor;if(rawLocation) | 396 var anchor;if(rawLocation) |
398 anchor=this._parentPane._linkifier.linkifyCSSLocation(mediaHeader.id,rawLocation
);else{anchor=WebInspector.linkifyResourceAsNode(media.sourceURL,undefined,"subt
itle",media.sourceURL);} | 397 anchor=this._parentPane._linkifier.linkifyCSSLocation(mediaHeader.id,rawLocation
);else{anchor=WebInspector.linkifyResourceAsNode(media.sourceURL,undefined,"subt
itle",media.sourceURL);} |
399 anchor.preferredPanel="sources";anchor.style.float="right";refElement.appendChil
d(anchor);} | 398 anchor.preferredPanel="sources";anchor.style.float="right";refElement.appendChil
d(anchor);} |
400 var mediaTextElement=mediaDataElement.createChild("span");mediaTextElement.textC
ontent=mediaText;mediaTextElement.title=media.text;}} | 399 var mediaTextElement=mediaDataElement.createChild("span");mediaTextElement.textC
ontent=mediaText;mediaTextElement.title=media.text;}} |
401 var selectorContainer=document.createElement("div");this._selectorElement=docume
nt.createElement("span");this._selectorElement.textContent=styleRule.selectorTex
t;selectorContainer.appendChild(this._selectorElement);var openBrace=document.cr
eateElement("span");openBrace.textContent=" {";selectorContainer.appendChild(ope
nBrace);selectorContainer.addEventListener("mousedown",this._handleEmptySpaceMou
seDown.bind(this),false);selectorContainer.addEventListener("click",this._handle
SelectorContainerClick.bind(this),false);var closeBrace=document.createElement("
div");closeBrace.textContent="}";this.element.appendChild(closeBrace);this._sele
ctorElement.addEventListener("click",this._handleSelectorClick.bind(this),false)
;this.element.addEventListener("mousedown",this._handleEmptySpaceMouseDown.bind(
this),false);this.element.addEventListener("click",this._handleEmptySpaceClick.b
ind(this),false);if(this.rule){if(this.rule.isUserAgent||this.rule.isUser) | 400 var selectorContainer=document.createElement("div");this._selectorElement=docume
nt.createElement("span");this._selectorElement.textContent=styleRule.selectorTex
t;selectorContainer.appendChild(this._selectorElement);var openBrace=document.cr
eateElement("span");openBrace.textContent=" {";selectorContainer.appendChild(ope
nBrace);selectorContainer.addEventListener("mousedown",this._handleEmptySpaceMou
seDown.bind(this),false);selectorContainer.addEventListener("click",this._handle
SelectorContainerClick.bind(this),false);var closeBrace=document.createElement("
div");closeBrace.textContent="}";this.element.appendChild(closeBrace);this._sele
ctorElement.addEventListener("click",this._handleSelectorClick.bind(this),false)
;this.element.addEventListener("mousedown",this._handleEmptySpaceMouseDown.bind(
this),false);this.element.addEventListener("click",this._handleEmptySpaceClick.b
ind(this),false);if(this.rule){if(this.rule.isUserAgent||this.rule.isUser) |
402 this.editable=false;else{if(this.rule.id) | 401 this.editable=false;else{if(this.rule.id) |
403 this.navigable=!!this.rule.resourceURL();} | 402 this.navigable=!!this.rule.resourceURL();} |
404 this.titleElement.addStyleClass("styles-selector");} | 403 this.titleElement.addStyleClass("styles-selector");} |
405 this._usedProperties=styleRule.usedProperties;this._selectorRefElement=document.
createElement("div");this._selectorRefElement.className="subtitle";this._selecto
rRefElement.appendChild(this._createRuleOriginNode());selectorContainer.insertBe
fore(this._selectorRefElement,selectorContainer.firstChild);this.titleElement.ap
pendChild(selectorContainer);this._selectorContainer=selectorContainer;if(isInhe
rited) | 404 this._usedProperties=styleRule.usedProperties;this._selectorRefElement=document.
createElement("div");this._selectorRefElement.className="subtitle";this._updateR
uleOrigin();selectorContainer.insertBefore(this._selectorRefElement,selectorCont
ainer.firstChild);this.titleElement.appendChild(selectorContainer);this._selecto
rContainer=selectorContainer;if(isInherited) |
406 this.element.addStyleClass("show-inherited");if(this.navigable) | 405 this.element.addStyleClass("show-inherited");if(this.navigable) |
407 this.element.addStyleClass("navigable");if(!this.editable) | 406 this.element.addStyleClass("navigable");if(!this.editable) |
408 this.element.addStyleClass("read-only");} | 407 this.element.addStyleClass("read-only");} |
409 WebInspector.StylePropertiesSection.prototype={get pane() | 408 WebInspector.StylePropertiesSection.prototype={get pane() |
410 {return this._parentPane;},collapse:function() | 409 {return this._parentPane;},collapse:function() |
411 {},isPropertyInherited:function(propertyName) | 410 {},isPropertyInherited:function(propertyName) |
412 {if(this.isInherited){return!WebInspector.CSSMetadata.isPropertyInherited(proper
tyName);} | 411 {if(this.isInherited){return!WebInspector.CSSMetadata.isPropertyInherited(proper
tyName);} |
413 return false;},isPropertyOverloaded:function(propertyName,isShorthand) | 412 return false;},isPropertyOverloaded:function(propertyName,isShorthand) |
414 {if(!this._usedProperties||this.noAffect) | 413 {if(!this._usedProperties||this.noAffect) |
415 return false;if(this.isInherited&&!WebInspector.CSSMetadata.isPropertyInherited(
propertyName)){return false;} | 414 return false;if(this.isInherited&&!WebInspector.CSSMetadata.isPropertyInherited(
propertyName)){return false;} |
(...skipping 16 matching lines...) Expand all Loading... |
432 return;} | 431 return;} |
433 var generatedShorthands={};for(var i=0;i<allProperties.length;++i){var property=
allProperties[i];this.uniqueProperties.push(property);var isShorthand=!!WebInspe
ctor.CSSMetadata.cssPropertiesMetainfo.longhands(property.name);var shorthands=i
sShorthand?null:WebInspector.CSSMetadata.cssPropertiesMetainfo.shorthands(proper
ty.name);var shorthandPropertyAvailable=false;for(var j=0;shorthands&&!shorthand
PropertyAvailable&&j<shorthands.length;++j){var shorthand=shorthands[j];if(short
hand in generatedShorthands){shorthandPropertyAvailable=true;continue;} | 432 var generatedShorthands={};for(var i=0;i<allProperties.length;++i){var property=
allProperties[i];this.uniqueProperties.push(property);var isShorthand=!!WebInspe
ctor.CSSMetadata.cssPropertiesMetainfo.longhands(property.name);var shorthands=i
sShorthand?null:WebInspector.CSSMetadata.cssPropertiesMetainfo.shorthands(proper
ty.name);var shorthandPropertyAvailable=false;for(var j=0;shorthands&&!shorthand
PropertyAvailable&&j<shorthands.length;++j){var shorthand=shorthands[j];if(short
hand in generatedShorthands){shorthandPropertyAvailable=true;continue;} |
434 if(style.getLiveProperty(shorthand)){shorthandPropertyAvailable=true;continue;} | 433 if(style.getLiveProperty(shorthand)){shorthandPropertyAvailable=true;continue;} |
435 if(!style.shorthandValue(shorthand)){shorthandPropertyAvailable=false;continue;} | 434 if(!style.shorthandValue(shorthand)){shorthandPropertyAvailable=false;continue;} |
436 var shorthandProperty=new WebInspector.CSSProperty(style,style.allProperties.len
gth,shorthand,style.shorthandValue(shorthand),"","style",true,true);var overload
ed=property.inactive||this.isPropertyOverloaded(property.name,true);var item=new
WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,style,sho
rthandProperty,true,false,overloaded);this.propertiesTreeOutline.appendChild(ite
m);generatedShorthands[shorthand]=shorthandProperty;shorthandPropertyAvailable=t
rue;} | 435 var shorthandProperty=new WebInspector.CSSProperty(style,style.allProperties.len
gth,shorthand,style.shorthandValue(shorthand),"","style",true,true);var overload
ed=property.inactive||this.isPropertyOverloaded(property.name,true);var item=new
WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,style,sho
rthandProperty,true,false,overloaded);this.propertiesTreeOutline.appendChild(ite
m);generatedShorthands[shorthand]=shorthandProperty;shorthandPropertyAvailable=t
rue;} |
437 if(shorthandPropertyAvailable) | 436 if(shorthandPropertyAvailable) |
438 continue;var inherited=this.isPropertyInherited(property.name);var overloaded=pr
operty.inactive||this.isPropertyOverloaded(property.name,isShorthand);var item=n
ew WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,style,p
roperty,isShorthand,inherited,overloaded);this.propertiesTreeOutline.appendChild
(item);}},_markSelectorMatches:function() | 437 continue;var inherited=this.isPropertyInherited(property.name);var overloaded=pr
operty.inactive||this.isPropertyOverloaded(property.name,isShorthand);var item=n
ew WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,style,p
roperty,isShorthand,inherited,overloaded);this.propertiesTreeOutline.appendChild
(item);}},_markSelectorMatches:function() |
439 {var rule=this.styleRule.rule;if(!rule) | 438 {var rule=this.styleRule.rule;if(!rule) |
440 return;var matchingSelectors=rule.matchingSelectors;if(this.noAffect||matchingSe
lectors) | 439 return;var matchingSelectors=rule.matchingSelectors;if(this.noAffect||matchingSe
lectors) |
441 this._selectorElement.className="selector";if(!matchingSelectors) | 440 this._selectorElement.className="selector";if(!matchingSelectors) |
442 return;var selectors=rule.selectors;var fragment=document.createDocumentFragment
();var currentMatch=0;for(var i=0,lastSelectorIndex=selectors.length-1;i<=lastSe
lectorIndex;++i){var selectorNode;var textNode=document.createTextNode(selectors
[i]);if(matchingSelectors[currentMatch]===i){++currentMatch;selectorNode=documen
t.createElement("span");selectorNode.className="selector-matches";selectorNode.a
ppendChild(textNode);}else | 441 return;var selectors=rule.selectors;var fragment=document.createDocumentFragment
();var currentMatch=0;for(var i=0;i<selectors.length;++i){if(i) |
443 selectorNode=textNode;fragment.appendChild(selectorNode);if(i!==lastSelectorInde
x) | 442 fragment.appendChild(document.createTextNode(", "));var isSelectorMatching=match
ingSelectors[currentMatch]===i;if(isSelectorMatching) |
444 fragment.appendChild(document.createTextNode(", "));} | 443 ++currentMatch;var rawLocation=new WebInspector.CSSLocation(rule.sourceURL,rule.
lineNumberInSource(i),rule.columnNumberInSource(i));var matchingSelectorClass=is
SelectorMatching?" selector-matches":"";var selectorElement=document.createEleme
nt("span");selectorElement.className="simple-selector"+matchingSelectorClass;if(
rule.id) |
| 444 selectorElement._selectorIndex=i;selectorElement.textContent=selectors[i].value;
fragment.appendChild(selectorElement);} |
445 this._selectorElement.removeChildren();this._selectorElement.appendChild(fragmen
t);},_checkWillCancelEditing:function() | 445 this._selectorElement.removeChildren();this._selectorElement.appendChild(fragmen
t);},_checkWillCancelEditing:function() |
446 {var willCauseCancelEditing=this._willCauseCancelEditing;delete this._willCauseC
ancelEditing;return willCauseCancelEditing;},_handleSelectorContainerClick:funct
ion(event) | 446 {var willCauseCancelEditing=this._willCauseCancelEditing;delete this._willCauseC
ancelEditing;return willCauseCancelEditing;},_handleSelectorContainerClick:funct
ion(event) |
447 {if(this._checkWillCancelEditing()||!this.editable) | 447 {if(this._checkWillCancelEditing()||!this.editable) |
448 return;if(event.target===this._selectorContainer) | 448 return;if(event.target===this._selectorContainer) |
449 this.addNewBlankProperty(0).startEditing();},addNewBlankProperty:function(index) | 449 this.addNewBlankProperty(0).startEditing();},addNewBlankProperty:function(index) |
450 {var style=this.styleRule.style;var property=style.newBlankProperty(index);var i
tem=new WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,st
yle,property,false,false,false);index=property.index;this.propertiesTreeOutline.
insertChild(item,index);item.listItemElement.textContent="";item._newProperty=tr
ue;item.updateTitle();return item;},_createRuleOriginNode:function() | 450 {var style=this.styleRule.style;var property=style.newBlankProperty(index);var i
tem=new WebInspector.StylePropertyTreeElement(this._parentPane,this.styleRule,st
yle,property,false,false,false);index=property.index;this.propertiesTreeOutline.
insertChild(item,index);item.listItemElement.textContent="";item._newProperty=tr
ue;item.updateTitle();return item;},_createRuleOriginNode:function() |
451 {function linkifyUncopyable(url,line) | 451 {function linkifyUncopyable(url,line) |
452 {var link=WebInspector.linkifyResourceAsNode(url,line,"",url+":"+(line+1));link.
preferredPanel="sources";link.classList.add("webkit-html-resource-link");link.se
tAttribute("data-uncopyable",link.textContent);link.textContent="";return link;} | 452 {var link=WebInspector.linkifyResourceAsNode(url,line,"",url+":"+(line+1));link.
preferredPanel="sources";link.classList.add("webkit-html-resource-link");link.se
tAttribute("data-uncopyable",link.textContent);link.textContent="";return link;} |
453 if(this.styleRule.sourceURL) | 453 if(this.styleRule.sourceURL){var firstMatchingIndex=this.styleRule.rule.matching
Selectors&&this.rule.matchingSelectors.length?this.rule.matchingSelectors[0]:0;v
ar matchingSelectorLocation=new WebInspector.CSSLocation(this.styleRule.sourceUR
L,this.rule.lineNumberInSource(firstMatchingIndex),this.rule.columnNumberInSourc
e(firstMatchingIndex));return this._parentPane._linkifier.linkifyCSSLocation(thi
s.rule.id.styleSheetId,matchingSelectorLocation)||linkifyUncopyable(this.styleRu
le.sourceURL,this.rule.lineNumberInSource());} |
454 return this._parentPane._linkifier.linkifyCSSLocation(this.rule.id.styleSheetId,
this.rule.rawLocation)||linkifyUncopyable(this.styleRule.sourceURL,this.rule.lin
eNumberInSource());if(!this.rule) | 454 if(!this.rule) |
455 return document.createTextNode("");if(this.rule.isUserAgent) | 455 return document.createTextNode("");if(this.rule.isUserAgent) |
456 return document.createTextNode(WebInspector.UIString("user agent stylesheet"));i
f(this.rule.isUser) | 456 return document.createTextNode(WebInspector.UIString("user agent stylesheet"));i
f(this.rule.isUser) |
457 return document.createTextNode(WebInspector.UIString("user stylesheet"));if(this
.rule.isViaInspector) | 457 return document.createTextNode(WebInspector.UIString("user stylesheet"));if(this
.rule.isViaInspector) |
458 return document.createTextNode(WebInspector.UIString("via inspector"));return do
cument.createTextNode("");},_handleEmptySpaceMouseDown:function() | 458 return document.createTextNode(WebInspector.UIString("via inspector"));return do
cument.createTextNode("");},_handleEmptySpaceMouseDown:function() |
459 {this._willCauseCancelEditing=this._parentPane._isEditingStyle;},_handleEmptySpa
ceClick:function(event) | 459 {this._willCauseCancelEditing=this._parentPane._isEditingStyle;},_handleEmptySpa
ceClick:function(event) |
460 {if(!this.editable) | 460 {if(!this.editable) |
461 return;if(!window.getSelection().isCollapsed) | 461 return;if(!window.getSelection().isCollapsed) |
462 return;if(this._checkWillCancelEditing()) | 462 return;if(this._checkWillCancelEditing()) |
463 return;if(event.target.hasStyleClass("header")||this.element.hasStyleClass("read
-only")||event.target.enclosingNodeOrSelfWithClass("media")){event.consume();ret
urn;} | 463 return;if(event.target.hasStyleClass("header")||this.element.hasStyleClass("read
-only")||event.target.enclosingNodeOrSelfWithClass("media")){event.consume();ret
urn;} |
464 this.expand();this.addNewBlankProperty().startEditing();},_handleSelectorClick:f
unction(event) | 464 this.expand();this.addNewBlankProperty().startEditing();},_handleSelectorClick:f
unction(event) |
465 {this._startEditingOnMouseEvent();event.consume(true);},_startEditingOnMouseEven
t:function() | 465 {if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&this.navigable&&eve
nt.target.hasStyleClass("simple-selector")){var index=event.target._selectorInde
x;var range=this.rule.selectors[index].range;var styleSheetHeader=WebInspector.c
ssModel.styleSheetHeaderForId(this.rule.id.styleSheetId);var uiLocation=styleShe
etHeader.rawLocationToUILocation(this.rule.lineNumberInSource(index),this.rule.c
olumnNumberInSource(index));if(uiLocation) |
| 466 WebInspector.panel("sources").showUILocation(uiLocation);return;} |
| 467 this._startEditingOnMouseEvent();event.consume(true);},_startEditingOnMouseEvent
:function() |
466 {if(!this.editable) | 468 {if(!this.editable) |
467 return;if(!this.rule&&this.propertiesTreeOutline.children.length===0){this.expan
d();this.addNewBlankProperty().startEditing();return;} | 469 return;if(!this.rule&&this.propertiesTreeOutline.children.length===0){this.expan
d();this.addNewBlankProperty().startEditing();return;} |
468 if(!this.rule) | 470 if(!this.rule) |
469 return;this.startEditingSelector();},startEditingSelector:function() | 471 return;this.startEditingSelector();},startEditingSelector:function() |
470 {var element=this._selectorElement;if(WebInspector.isBeingEdited(element)) | 472 {var element=this._selectorElement;if(WebInspector.isBeingEdited(element)) |
471 return;element.scrollIntoViewIfNeeded(false);element.textContent=element.textCon
tent;var config=new WebInspector.EditingConfig(this.editingSelectorCommitted.bin
d(this),this.editingSelectorCancelled.bind(this));WebInspector.startEditing(this
._selectorElement,config);window.getSelection().setBaseAndExtent(element,0,eleme
nt,1);},_moveEditorFromSelector:function(moveDirection) | 473 return;element.scrollIntoViewIfNeeded(false);element.textContent=element.textCon
tent;var config=new WebInspector.EditingConfig(this.editingSelectorCommitted.bin
d(this),this.editingSelectorCancelled.bind(this));WebInspector.startEditing(this
._selectorElement,config);window.getSelection().setBaseAndExtent(element,0,eleme
nt,1);},_moveEditorFromSelector:function(moveDirection) |
472 {this._markSelectorMatches();if(!moveDirection) | 474 {this._markSelectorMatches();if(!moveDirection) |
473 return;if(moveDirection==="forward"){this.expand();var firstChild=this.propertie
sTreeOutline.children[0];while(firstChild&&firstChild.inherited) | 475 return;if(moveDirection==="forward"){this.expand();var firstChild=this.propertie
sTreeOutline.children[0];while(firstChild&&firstChild.inherited) |
474 firstChild=firstChild.nextSibling;if(!firstChild) | 476 firstChild=firstChild.nextSibling;if(!firstChild) |
475 this.addNewBlankProperty().startEditing();else | 477 this.addNewBlankProperty().startEditing();else |
476 firstChild.startEditing(firstChild.nameElement);}else{var previousSection=this.p
reviousEditableSibling();if(!previousSection) | 478 firstChild.startEditing(firstChild.nameElement);}else{var previousSection=this.p
reviousEditableSibling();if(!previousSection) |
477 return;previousSection.expand();previousSection.addNewBlankProperty().startEditi
ng();}},editingSelectorCommitted:function(element,newContent,oldContent,context,
moveDirection) | 479 return;previousSection.expand();previousSection.addNewBlankProperty().startEditi
ng();}},editingSelectorCommitted:function(element,newContent,oldContent,context,
moveDirection) |
478 {if(newContent) | 480 {if(newContent) |
479 newContent=newContent.trim();if(newContent===oldContent){this._selectorElement.t
extContent=newContent;return this._moveEditorFromSelector(moveDirection);} | 481 newContent=newContent.trim();if(newContent===oldContent){this._selectorElement.t
extContent=newContent;return this._moveEditorFromSelector(moveDirection);} |
480 var selectedNode=this._parentPane.node;function successCallback(newRule,doesAffe
ctSelectedNode) | 482 var selectedNode=this._parentPane.node;function successCallback(newRule) |
481 {if(!doesAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("no-a
ffect");}else{delete this.noAffect;this.element.removeStyleClass("no-affect");} | 483 {var doesAffectSelectedNode=newRule.matchingSelectors.length>0;if(!doesAffectSel
ectedNode){this.noAffect=true;this.element.addStyleClass("no-affect");}else{dele
te this.noAffect;this.element.removeStyleClass("no-affect");} |
482 this.rule=newRule;this.styleRule={section:this,style:newRule.style,selectorText:
newRule.selectorText,media:newRule.media,sourceURL:newRule.resourceURL(),rule:ne
wRule};this._parentPane.update(selectedNode);finishOperationAndMoveEditor.call(t
his,moveDirection);} | 484 this.rule=newRule;this.styleRule={section:this,style:newRule.style,selectorText:
newRule.selectorText,media:newRule.media,sourceURL:newRule.resourceURL(),rule:ne
wRule};this._parentPane.update(selectedNode);this._updateRuleOrigin();finishOper
ationAndMoveEditor.call(this,moveDirection);} |
483 function finishOperationAndMoveEditor(direction) | 485 function finishOperationAndMoveEditor(direction) |
484 {delete this._parentPane._userOperation;this._moveEditorFromSelector(direction);
} | 486 {delete this._parentPane._userOperation;this._moveEditorFromSelector(direction);
} |
485 this._parentPane._userOperation=true;WebInspector.cssModel.setRuleSelector(this.
rule.id,selectedNode?selectedNode.id:0,newContent,successCallback.bind(this),fin
ishOperationAndMoveEditor.bind(this,moveDirection));},editingSelectorCancelled:f
unction() | 487 this._parentPane._userOperation=true;WebInspector.cssModel.setRuleSelector(this.
rule.id,selectedNode?selectedNode.id:0,newContent,successCallback.bind(this),fin
ishOperationAndMoveEditor.bind(this,moveDirection));},_updateRuleOrigin:function
() |
| 488 {this._selectorRefElement.removeChildren();this._selectorRefElement.appendChild(
this._createRuleOriginNode());},editingSelectorCancelled:function() |
486 {this._markSelectorMatches();},__proto__:WebInspector.PropertiesSection.prototyp
e} | 489 {this._markSelectorMatches();},__proto__:WebInspector.PropertiesSection.prototyp
e} |
487 WebInspector.ComputedStylePropertiesSection=function(stylesPane,styleRule,usedPr
operties) | 490 WebInspector.ComputedStylePropertiesSection=function(stylesPane,styleRule,usedPr
operties) |
488 {WebInspector.PropertiesSection.call(this,"");this.headerElement.addStyleClass("
hidden");this.element.className="styles-section monospace first-styles-section r
ead-only computed-style";this._stylesPane=stylesPane;this.styleRule=styleRule;th
is._usedProperties=usedProperties;this._alwaysShowComputedProperties={"display":
true,"height":true,"width":true};this.computedStyle=true;this._propertyTreeEleme
nts={};this._expandedPropertyNames={};} | 491 {WebInspector.PropertiesSection.call(this,"");this.headerElement.addStyleClass("
hidden");this.element.className="styles-section monospace read-only computed-sty
le";this._stylesPane=stylesPane;this.styleRule=styleRule;this._usedProperties=us
edProperties;this._alwaysShowComputedProperties={"display":true,"height":true,"w
idth":true};this.computedStyle=true;this._propertyTreeElements={};this._expanded
PropertyNames={};} |
489 WebInspector.ComputedStylePropertiesSection.prototype={collapse:function(dontRem
emberState) | 492 WebInspector.ComputedStylePropertiesSection.prototype={collapse:function(dontRem
emberState) |
490 {},_isPropertyInherited:function(propertyName) | 493 {},_isPropertyInherited:function(propertyName) |
491 {var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(propertyName);
return!(canonicalName in this._usedProperties)&&!(canonicalName in this._alwaysS
howComputedProperties);},update:function() | 494 {var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(propertyName);
return!(canonicalName in this._usedProperties)&&!(canonicalName in this._alwaysS
howComputedProperties);},update:function() |
492 {this._expandedPropertyNames={};for(var name in this._propertyTreeElements){if(t
his._propertyTreeElements[name].expanded) | 495 {this._expandedPropertyNames={};for(var name in this._propertyTreeElements){if(t
his._propertyTreeElements[name].expanded) |
493 this._expandedPropertyNames[name]=true;} | 496 this._expandedPropertyNames[name]=true;} |
494 this._propertyTreeElements={};this.propertiesTreeOutline.removeChildren();this.p
opulated=false;},onpopulate:function() | 497 this._propertyTreeElements={};this.propertiesTreeOutline.removeChildren();this.p
opulated=false;},onpopulate:function() |
495 {function sorter(a,b) | 498 {function sorter(a,b) |
496 {return a.name.compareTo(b.name);} | 499 {return a.name.compareTo(b.name);} |
497 var style=this.styleRule.style;if(!style) | 500 var style=this.styleRule.style;if(!style) |
498 return;var uniqueProperties=[];var allProperties=style.allProperties;for(var i=0
;i<allProperties.length;++i) | 501 return;var uniqueProperties=[];var allProperties=style.allProperties;for(var i=0
;i<allProperties.length;++i) |
499 uniqueProperties.push(allProperties[i]);uniqueProperties.sort(sorter);this._prop
ertyTreeElements={};for(var i=0;i<uniqueProperties.length;++i){var property=uniq
ueProperties[i];var inherited=this._isPropertyInherited(property.name);var item=
new WebInspector.ComputedStylePropertyTreeElement(this._stylesPane,this.styleRul
e,style,property,inherited);this.propertiesTreeOutline.appendChild(item);this._p
ropertyTreeElements[property.name]=item;}},rebuildComputedTrace:function(section
s) | 502 uniqueProperties.push(allProperties[i]);uniqueProperties.sort(sorter);this._prop
ertyTreeElements={};for(var i=0;i<uniqueProperties.length;++i){var property=uniq
ueProperties[i];var inherited=this._isPropertyInherited(property.name);var item=
new WebInspector.ComputedStylePropertyTreeElement(this._stylesPane,this.styleRul
e,style,property,inherited);this.propertiesTreeOutline.appendChild(item);this._p
ropertyTreeElements[property.name]=item;}},rebuildComputedTrace:function(section
s) |
500 {for(var i=0;i<sections.length;++i){var section=sections[i];if(section.computedS
tyle||section.isBlank) | 503 {for(var i=0;i<sections.length;++i){var section=sections[i];if(section.computedS
tyle||section.isBlank) |
501 continue;for(var j=0;j<section.uniqueProperties.length;++j){var property=section
.uniqueProperties[j];if(property.disabled) | 504 continue;for(var j=0;j<section.uniqueProperties.length;++j){var property=section
.uniqueProperties[j];if(property.disabled) |
502 continue;if(section.isInherited&&!WebInspector.CSSMetadata.isPropertyInherited(p
roperty.name)) | 505 continue;if(section.isInherited&&!WebInspector.CSSMetadata.isPropertyInherited(p
roperty.name)) |
503 continue;var treeElement=this._propertyTreeElements[property.name.toLowerCase()]
;if(treeElement){var fragment=document.createDocumentFragment();var selector=fra
gment.createChild("span");selector.style.color="gray";selector.textContent=secti
on.styleRule.selectorText;fragment.appendChild(document.createTextNode(" - "+pro
perty.value+" "));var subtitle=fragment.createChild("span");subtitle.style.float
="right";subtitle.appendChild(section._createRuleOriginNode());var childElement=
new TreeElement(fragment,null,false);treeElement.appendChild(childElement);if(pr
operty.inactive||section.isPropertyOverloaded(property.name)) | 506 continue;var treeElement=this._propertyTreeElements[property.name.toLowerCase()]
;if(treeElement){var fragment=document.createDocumentFragment();var selector=fra
gment.createChild("span");selector.style.color="gray";selector.textContent=secti
on.styleRule.selectorText;fragment.appendChild(document.createTextNode(" - "+pro
perty.value+" "));var subtitle=fragment.createChild("span");subtitle.style.float
="right";subtitle.appendChild(section._createRuleOriginNode());var childElement=
new TreeElement(fragment,null,false);treeElement.appendChild(childElement);if(pr
operty.inactive||section.isPropertyOverloaded(property.name)) |
504 childElement.listItemElement.addStyleClass("overloaded");if(!property.parsedOk){
childElement.listItemElement.addStyleClass("not-parsed-ok");childElement.listIte
mElement.insertBefore(WebInspector.StylesSidebarPane.createExclamationMark(prope
rty),childElement.listItemElement.firstChild);if(WebInspector.StylesSidebarPane.
_ignoreErrorsForProperty(property)) | 507 childElement.listItemElement.addStyleClass("overloaded");if(!property.parsedOk){
childElement.listItemElement.addStyleClass("not-parsed-ok");childElement.listIte
mElement.insertBefore(WebInspector.StylesSidebarPane.createExclamationMark(prope
rty),childElement.listItemElement.firstChild);if(WebInspector.StylesSidebarPane.
_ignoreErrorsForProperty(property)) |
505 childElement.listItemElement.addStyleClass("has-ignorable-error");}}}} | 508 childElement.listItemElement.addStyleClass("has-ignorable-error");}}}} |
506 for(var name in this._expandedPropertyNames){if(name in this._propertyTreeElemen
ts) | 509 for(var name in this._expandedPropertyNames){if(name in this._propertyTreeElemen
ts) |
507 this._propertyTreeElements[name].expand();}},__proto__:WebInspector.PropertiesSe
ction.prototype} | 510 this._propertyTreeElements[name].expand();}},__proto__:WebInspector.PropertiesSe
ction.prototype} |
508 WebInspector.BlankStylePropertiesSection=function(stylesPane,defaultSelectorText
) | 511 WebInspector.BlankStylePropertiesSection=function(stylesPane,defaultSelectorText
) |
509 {WebInspector.StylePropertiesSection.call(this,stylesPane,{selectorText:defaultS
electorText,rule:{isViaInspector:true}},true,false,false);this.element.addStyleC
lass("blank-section");} | 512 {WebInspector.StylePropertiesSection.call(this,stylesPane,{selectorText:defaultS
electorText,rule:{isViaInspector:true}},true,false);this.element.addStyleClass("
blank-section");} |
510 WebInspector.BlankStylePropertiesSection.prototype={get isBlank() | 513 WebInspector.BlankStylePropertiesSection.prototype={get isBlank() |
511 {return!this._normal;},expand:function() | 514 {return!this._normal;},expand:function() |
512 {if(!this.isBlank) | 515 {if(!this.isBlank) |
513 WebInspector.StylePropertiesSection.prototype.expand.call(this);},editingSelecto
rCommitted:function(element,newContent,oldContent,context,moveDirection) | 516 WebInspector.StylePropertiesSection.prototype.expand.call(this);},editingSelecto
rCommitted:function(element,newContent,oldContent,context,moveDirection) |
514 {if(!this.isBlank){WebInspector.StylePropertiesSection.prototype.editingSelector
Committed.call(this,element,newContent,oldContent,context,moveDirection);return;
} | 517 {if(!this.isBlank){WebInspector.StylePropertiesSection.prototype.editingSelector
Committed.call(this,element,newContent,oldContent,context,moveDirection);return;
} |
515 function successCallback(newRule,doesSelectorAffectSelectedNode) | 518 function successCallback(newRule) |
516 {var styleRule={section:this,style:newRule.style,selectorText:newRule.selectorTe
xt,sourceURL:newRule.resourceURL(),rule:newRule};this.makeNormal(styleRule);if(!
doesSelectorAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("n
o-affect");} | 519 {var doesSelectorAffectSelectedNode=newRule.matchingSelectors.length>0;var style
Rule={section:this,style:newRule.style,selectorText:newRule.selectorText,sourceU
RL:newRule.resourceURL(),rule:newRule};this.makeNormal(styleRule);if(!doesSelect
orAffectSelectedNode){this.noAffect=true;this.element.addStyleClass("no-affect")
;} |
517 this._selectorRefElement.removeChildren();this._selectorRefElement.appendChild(t
his._createRuleOriginNode());this.expand();if(this.element.parentElement) | 520 this._updateRuleOrigin();this.expand();if(this.element.parentElement) |
518 this._moveEditorFromSelector(moveDirection);this._markSelectorMatches();delete t
his._parentPane._userOperation;} | 521 this._moveEditorFromSelector(moveDirection);this._markSelectorMatches();delete t
his._parentPane._userOperation;} |
519 if(newContent) | 522 if(newContent) |
520 newContent=newContent.trim();this._parentPane._userOperation=true;WebInspector.c
ssModel.addRule(this.pane.node.id,newContent,successCallback.bind(this),this.edi
tingSelectorCancelled.bind(this));},editingSelectorCancelled:function() | 523 newContent=newContent.trim();this._parentPane._userOperation=true;WebInspector.c
ssModel.addRule(this.pane.node.id,newContent,successCallback.bind(this),this.edi
tingSelectorCancelled.bind(this));},editingSelectorCancelled:function() |
521 {delete this._parentPane._userOperation;if(!this.isBlank){WebInspector.StyleProp
ertiesSection.prototype.editingSelectorCancelled.call(this);return;} | 524 {delete this._parentPane._userOperation;if(!this.isBlank){WebInspector.StyleProp
ertiesSection.prototype.editingSelectorCancelled.call(this);return;} |
522 this.pane.removeSection(this);},makeNormal:function(styleRule) | 525 this.pane.removeSection(this);},makeNormal:function(styleRule) |
523 {this.element.removeStyleClass("blank-section");this.styleRule=styleRule;this.ru
le=styleRule.rule;this._normal=true;},__proto__:WebInspector.StylePropertiesSect
ion.prototype} | 526 {this.element.removeStyleClass("blank-section");this.styleRule=styleRule;this.ru
le=styleRule.rule;this._normal=true;},__proto__:WebInspector.StylePropertiesSect
ion.prototype} |
524 WebInspector.StylePropertyTreeElementBase=function(styleRule,style,property,inhe
rited,overloaded,hasChildren) | 527 WebInspector.StylePropertyTreeElementBase=function(styleRule,style,property,inhe
rited,overloaded,hasChildren) |
525 {this._styleRule=styleRule;this.style=style;this.property=property;this._inherit
ed=inherited;this._overloaded=overloaded;TreeElement.call(this,"",null,hasChildr
en);this.selectable=false;} | 528 {this._styleRule=styleRule;this.style=style;this.property=property;this._inherit
ed=inherited;this._overloaded=overloaded;TreeElement.call(this,"",null,hasChildr
en);this.selectable=false;} |
526 WebInspector.StylePropertyTreeElementBase.prototype={node:function() | 529 WebInspector.StylePropertyTreeElementBase.prototype={node:function() |
527 {return null;},editablePane:function() | 530 {return null;},editablePane:function() |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 {if(this._parentPane){this._parentPane._mouseDownTreeElement=this;this._parentPa
ne._mouseDownTreeElementIsName=this._isNameElement(event.target);this._parentPan
e._mouseDownTreeElementIsValue=this._isValueElement(event.target);}},_resetMouse
DownElement:function() | 629 {if(this._parentPane){this._parentPane._mouseDownTreeElement=this;this._parentPa
ne._mouseDownTreeElementIsName=this._isNameElement(event.target);this._parentPan
e._mouseDownTreeElementIsValue=this._isValueElement(event.target);}},_resetMouse
DownElement:function() |
627 {if(this._parentPane){delete this._parentPane._mouseDownTreeElement;delete this.
_parentPane._mouseDownTreeElementIsName;delete this._parentPane._mouseDownTreeEl
ementIsValue;}},updateTitle:function() | 630 {if(this._parentPane){delete this._parentPane._mouseDownTreeElement;delete this.
_parentPane._mouseDownTreeElementIsName;delete this._parentPane._mouseDownTreeEl
ementIsValue;}},updateTitle:function() |
628 {WebInspector.StylePropertyTreeElementBase.prototype.updateTitle.call(this);if(t
his.parsedOk&&this.section()&&this.parent.root){var enabledCheckboxElement=docum
ent.createElement("input");enabledCheckboxElement.className="enabled-button";ena
bledCheckboxElement.type="checkbox";enabledCheckboxElement.checked=!this.disable
d;enabledCheckboxElement.addEventListener("click",this.toggleEnabled.bind(this),
false);this.listItemElement.insertBefore(enabledCheckboxElement,this.listItemEle
ment.firstChild);}},_mouseClick:function(event) | 631 {WebInspector.StylePropertyTreeElementBase.prototype.updateTitle.call(this);if(t
his.parsedOk&&this.section()&&this.parent.root){var enabledCheckboxElement=docum
ent.createElement("input");enabledCheckboxElement.className="enabled-button";ena
bledCheckboxElement.type="checkbox";enabledCheckboxElement.checked=!this.disable
d;enabledCheckboxElement.addEventListener("click",this.toggleEnabled.bind(this),
false);this.listItemElement.insertBefore(enabledCheckboxElement,this.listItemEle
ment.firstChild);}},_mouseClick:function(event) |
629 {if(!window.getSelection().isCollapsed) | 632 {if(!window.getSelection().isCollapsed) |
630 return;event.consume(true);if(event.target===this.listItemElement){var section=t
his.section();if(!section||!section.editable) | 633 return;event.consume(true);if(event.target===this.listItemElement){var section=t
his.section();if(!section||!section.editable) |
631 return;if(section._checkWillCancelEditing()) | 634 return;if(section._checkWillCancelEditing()) |
632 return;section.addNewBlankProperty(this.property.index+1).startEditing();return;
} | 635 return;section.addNewBlankProperty(this.property.index+1).startEditing();return;
} |
633 if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&this.section().navig
able){this._navigateToSource(event.target);return;} | 636 if(WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)&&this.section().navig
able){this._navigateToSource(event.target);return;} |
634 this.startEditing(event.target);},_navigateToSource:function(element) | 637 this.startEditing(event.target);},_navigateToSource:function(element) |
635 {console.assert(this.section().navigable);var propertyNameClicked=element===this
.nameElement;var uiLocation=this.property.uiLocation(propertyNameClicked);if(!ui
Location) | 638 {console.assert(this.section().navigable);var propertyNameClicked=element===this
.nameElement;var uiLocation=this.property.uiLocation(propertyNameClicked);if(!ui
Location) |
636 return;WebInspector.showPanel("sources").showUILocation(uiLocation);},_isNameEle
ment:function(element) | 639 return;WebInspector.panel("sources").showUILocation(uiLocation);},_isNameElement
:function(element) |
637 {return element.enclosingNodeOrSelfWithClass("webkit-css-property")===this.nameE
lement;},_isValueElement:function(element) | 640 {return element.enclosingNodeOrSelfWithClass("webkit-css-property")===this.nameE
lement;},_isValueElement:function(element) |
638 {return!!element.enclosingNodeOrSelfWithClass("value");},startEditing:function(s
electElement) | 641 {return!!element.enclosingNodeOrSelfWithClass("value");},startEditing:function(s
electElement) |
639 {if(this.parent.isShorthand) | 642 {if(this.parent.isShorthand) |
640 return;if(selectElement===this._expandElement) | 643 return;if(selectElement===this._expandElement) |
641 return;var section=this.section();if(section&&!section.editable) | 644 return;var section=this.section();if(section&&!section.editable) |
642 return;if(!selectElement) | 645 return;if(!selectElement) |
643 selectElement=this.nameElement;else | 646 selectElement=this.nameElement;else |
644 selectElement=selectElement.enclosingNodeOrSelfWithClass("webkit-css-property")|
|selectElement.enclosingNodeOrSelfWithClass("value");if(WebInspector.isBeingEdit
ed(selectElement)) | 647 selectElement=selectElement.enclosingNodeOrSelfWithClass("webkit-css-property")|
|selectElement.enclosingNodeOrSelfWithClass("value");if(WebInspector.isBeingEdit
ed(selectElement)) |
645 return;var isEditingName=selectElement===this.nameElement;if(!isEditingName) | 648 return;var isEditingName=selectElement===this.nameElement;if(!isEditingName) |
646 this.valueElement.textContent=restoreURLs(this.valueElement.textContent,this.val
ue);function restoreURLs(fieldValue,modelValue) | 649 this.valueElement.textContent=restoreURLs(this.valueElement.textContent,this.val
ue);function restoreURLs(fieldValue,modelValue) |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 WebInspector.TextPrompt.prototype.onMouseWheel.call(this,event);},tabKeyPressed:
function() | 756 WebInspector.TextPrompt.prototype.onMouseWheel.call(this,event);},tabKeyPressed:
function() |
754 {this.acceptAutoComplete();return false;},_handleNameOrValueUpDown:function(even
t) | 757 {this.acceptAutoComplete();return false;},_handleNameOrValueUpDown:function(even
t) |
755 {function finishHandler(originalValue,replacementString) | 758 {function finishHandler(originalValue,replacementString) |
756 {this._sidebarPane.applyStyleText(this._sidebarPane.nameElement.textContent+": "
+this._sidebarPane.valueElement.textContent,false,false,false);} | 759 {this._sidebarPane.applyStyleText(this._sidebarPane.nameElement.textContent+": "
+this._sidebarPane.valueElement.textContent,false,false,false);} |
757 if(!this._isEditingName&&WebInspector.handleElementValueModifications(event,this
._sidebarPane.valueElement,finishHandler.bind(this),this._isValueSuggestion.bind
(this))) | 760 if(!this._isEditingName&&WebInspector.handleElementValueModifications(event,this
._sidebarPane.valueElement,finishHandler.bind(this),this._isValueSuggestion.bind
(this))) |
758 return true;return false;},_isValueSuggestion:function(word) | 761 return true;return false;},_isValueSuggestion:function(word) |
759 {if(!word) | 762 {if(!word) |
760 return false;word=word.toLowerCase();return this._cssCompletions.keySet().hasOwn
Property(word);},_buildPropertyCompletions:function(proxyElement,wordRange,force
,completionsReadyCallback) | 763 return false;word=word.toLowerCase();return this._cssCompletions.keySet().hasOwn
Property(word);},_buildPropertyCompletions:function(proxyElement,wordRange,force
,completionsReadyCallback) |
761 {var prefix=wordRange.toString().toLowerCase();if(!prefix&&!force&&(this._isEdit
ingName||proxyElement.textContent.length)){completionsReadyCallback([]);return;} | 764 {var prefix=wordRange.toString().toLowerCase();if(!prefix&&!force&&(this._isEdit
ingName||proxyElement.textContent.length)){completionsReadyCallback([]);return;} |
762 var results=this._cssCompletions.startsWith(prefix);var selectedIndex=this._cssC
ompletions.mostUsedOf(results);completionsReadyCallback(results,selectedIndex);}
,__proto__:WebInspector.TextPrompt.prototype};WebInspector.ElementsPanel=functio
n() | 765 var results=this._cssCompletions.startsWith(prefix);var selectedIndex=this._cssC
ompletions.mostUsedOf(results);completionsReadyCallback(results,selectedIndex);}
,__proto__:WebInspector.TextPrompt.prototype};WebInspector.ElementsPanel=functio
n() |
763 {WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("breadcrumbLi
st.css");this.registerRequiredCSS("elementsPanel.css");this.registerRequiredCSS(
"textPrompt.css");this.setHideOnDetach();const initialSidebarWidth=325;const min
imumContentWidthPercent=0.34;const initialSidebarHeight=325;const minimumContent
HeightPercent=0.34;this.createSidebarView(this.element,WebInspector.SidebarView.
SidebarPosition.End,initialSidebarWidth,initialSidebarHeight);this.splitView.set
SidebarElementConstraints(Preferences.minElementsSidebarWidth,Preferences.minEle
mentsSidebarHeight);this.splitView.setMainElementConstraints(minimumContentWidth
Percent,minimumContentHeightPercent);this.splitView.addEventListener(WebInspecto
r.SidebarView.EventTypes.Resized,this._updateTreeOutlineVisibleWidth.bind(this))
;this.contentElement=this.splitView.mainElement;this.contentElement.id="elements
-content";this.contentElement.addStyleClass("outline-disclosure");this.contentEl
ement.addStyleClass("source-code");if(!WebInspector.settings.domWordWrap.get()) | 766 {WebInspector.Panel.call(this,"elements");this.registerRequiredCSS("breadcrumbLi
st.css");this.registerRequiredCSS("elementsPanel.css");this.registerRequiredCSS(
"textPrompt.css");this.setHideOnDetach();const initialSidebarWidth=325;const min
imumContentWidthPercent=0.34;const initialSidebarHeight=325;const minimumContent
HeightPercent=0.34;this.createSidebarView(this.element,WebInspector.SidebarView.
SidebarPosition.End,initialSidebarWidth,initialSidebarHeight);this.splitView.sid
ebarElement.addStyleClass("vbox");this.splitView.setSidebarElementConstraints(Pr
eferences.minElementsSidebarWidth,Preferences.minElementsSidebarHeight);this.spl
itView.setMainElementConstraints(minimumContentWidthPercent,minimumContentHeight
Percent);this.splitView.addEventListener(WebInspector.SidebarView.EventTypes.Res
ized,this._updateTreeOutlineVisibleWidth.bind(this));var stackElement=this.split
View.mainElement;stackElement.addStyleClass("vbox");this.contentElement=stackEle
ment.createChild("div");this.contentElement.id="elements-content";this.contentEl
ement.addStyleClass("outline-disclosure");this.contentElement.addStyleClass("sou
rce-code");if(!WebInspector.settings.domWordWrap.get()) |
764 this.contentElement.classList.add("nowrap");WebInspector.settings.domWordWrap.ad
dChangeListener(this._domWordWrapSettingChanged.bind(this));this.contentElement.
addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);this
.splitView.sidebarElement.addEventListener("contextmenu",this._sidebarContextMen
uEventFired.bind(this),false);this.treeOutline=new WebInspector.ElementsTreeOutl
ine(true,true,this._populateContextMenu.bind(this),this._setPseudoClassForNodeId
.bind(this));this.treeOutline.wireToDomAgent();this.treeOutline.addEventListener
(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedNodeC
hanged,this);this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.
Events.ElementsTreeUpdated,this._updateBreadcrumbIfNeeded,this);this.crumbsEleme
nt=document.createElement("div");this.crumbsElement.className="crumbs";this.crum
bsElement.addEventListener("mousemove",this._mouseMovedInCrumbs.bind(this),false
);this.crumbsElement.addEventListener("mouseout",this._mouseMovedOutOfCrumbs.bin
d(this),false);this.sidebarPanes={};this.sidebarPanes.platformFonts=new WebInspe
ctor.PlatformFontsSidebarPane();this.sidebarPanes.computedStyle=new WebInspector
.ComputedStyleSidebarPane();this.sidebarPanes.styles=new WebInspector.StylesSide
barPane(this.sidebarPanes.computedStyle,this._setPseudoClassForNodeId.bind(this)
);this.sidebarPanes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPa
nes.properties=new WebInspector.PropertiesSidebarPane();this.sidebarPanes.domBre
akpoints=WebInspector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPa
nes.eventListeners=new WebInspector.EventListenersSidebarPane();this.sidebarPane
s.styles.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.upda
teStyles.bind(this,false));this.sidebarPanes.metrics.addEventListener(WebInspect
or.SidebarPane.EventTypes.wasShown,this.updateMetrics.bind(this));this.sidebarPa
nes.platformFonts.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,
this.updatePlatformFonts.bind(this));this.sidebarPanes.properties.addEventListen
er(WebInspector.SidebarPane.EventTypes.wasShown,this.updateProperties.bind(this)
);this.sidebarPanes.eventListeners.addEventListener(WebInspector.SidebarPane.Eve
ntTypes.wasShown,this.updateEventListeners.bind(this));this.sidebarPanes.styles.
addEventListener("style edited",this._stylesPaneEdited,this);this.sidebarPanes.s
tyles.addEventListener("style property toggled",this._stylesPaneEdited,this);thi
s.sidebarPanes.metrics.addEventListener("metrics edited",this._metricsPaneEdited
,this);WebInspector.dockController.addEventListener(WebInspector.DockController.
Events.DockSideChanged,this._dockSideChanged.bind(this));WebInspector.settings.s
plitVerticallyWhenDockedToRight.addChangeListener(this._dockSideChanged.bind(thi
s));this._dockSideChanged();this._popoverHelper=new WebInspector.PopoverHelper(t
his.element,this._getPopoverAnchor.bind(this),this._showPopover.bind(this));this
._popoverHelper.setTimeout(0);WebInspector.domAgent.addEventListener(WebInspecto
r.DOMAgent.Events.DocumentUpdated,this._documentUpdatedEvent,this);WebInspector.
settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));
if(WebInspector.domAgent.existingDocument()) | 767 this.contentElement.classList.add("nowrap");WebInspector.settings.domWordWrap.ad
dChangeListener(this._domWordWrapSettingChanged.bind(this));this.contentElement.
addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);this
.splitView.sidebarElement.addEventListener("contextmenu",this._sidebarContextMen
uEventFired.bind(this),false);this.treeOutline=new WebInspector.ElementsTreeOutl
ine(true,true,this._populateContextMenu.bind(this),this._setPseudoClassForNodeId
.bind(this));this.treeOutline.wireToDomAgent();this.treeOutline.addEventListener
(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged,this._selectedNodeC
hanged,this);this.treeOutline.addEventListener(WebInspector.ElementsTreeOutline.
Events.ElementsTreeUpdated,this._updateBreadcrumbIfNeeded,this);var crumbsContai
ner=stackElement.createChild("div");crumbsContainer.id="elements-crumbs";this.cr
umbsElement=crumbsContainer.createChild("div","crumbs");this.crumbsElement.addEv
entListener("mousemove",this._mouseMovedInCrumbs.bind(this),false);this.crumbsEl
ement.addEventListener("mouseout",this._mouseMovedOutOfCrumbs.bind(this),false);
this.sidebarPanes={};this.sidebarPanes.platformFonts=new WebInspector.PlatformFo
ntsSidebarPane();this.sidebarPanes.computedStyle=new WebInspector.ComputedStyleS
idebarPane();this.sidebarPanes.styles=new WebInspector.StylesSidebarPane(this.si
debarPanes.computedStyle,this._setPseudoClassForNodeId.bind(this));this.sidebarP
anes.metrics=new WebInspector.MetricsSidebarPane();this.sidebarPanes.properties=
new WebInspector.PropertiesSidebarPane();this.sidebarPanes.domBreakpoints=WebIns
pector.domBreakpointsSidebarPane.createProxy(this);this.sidebarPanes.eventListen
ers=new WebInspector.EventListenersSidebarPane();this.sidebarPanes.styles.addEve
ntListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updateStyles.bind(t
his,false));this.sidebarPanes.metrics.addEventListener(WebInspector.SidebarPane.
EventTypes.wasShown,this.updateMetrics.bind(this));this.sidebarPanes.platformFon
ts.addEventListener(WebInspector.SidebarPane.EventTypes.wasShown,this.updatePlat
formFonts.bind(this));this.sidebarPanes.properties.addEventListener(WebInspector
.SidebarPane.EventTypes.wasShown,this.updateProperties.bind(this));this.sidebarP
anes.eventListeners.addEventListener(WebInspector.SidebarPane.EventTypes.wasShow
n,this.updateEventListeners.bind(this));this.sidebarPanes.styles.addEventListene
r("style edited",this._stylesPaneEdited,this);this.sidebarPanes.styles.addEventL
istener("style property toggled",this._stylesPaneEdited,this);this.sidebarPanes.
metrics.addEventListener("metrics edited",this._metricsPaneEdited,this);this._ex
tensionSidebarPanes=[];WebInspector.dockController.addEventListener(WebInspector
.DockController.Events.DockSideChanged,this._dockSideChanged.bind(this));WebInsp
ector.settings.splitVerticallyWhenDockedToRight.addChangeListener(this._dockSide
Changed.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.addEventList
ener(WebInspector.DOMAgent.Events.DocumentUpdated,this._documentUpdatedEvent,thi
s);WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChan
ged.bind(this));if(WebInspector.domAgent.existingDocument()) |
765 this._documentUpdated(WebInspector.domAgent.existingDocument());WebInspector.css
Model.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this._u
pdateSidebars,this);} | 768 this._documentUpdated(WebInspector.domAgent.existingDocument());WebInspector.css
Model.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled,this._u
pdateSidebars,this);} |
766 WebInspector.ElementsPanel.prototype={_updateTreeOutlineVisibleWidth:function() | 769 WebInspector.ElementsPanel.prototype={_updateTreeOutlineVisibleWidth:function() |
767 {if(!this.treeOutline) | 770 {if(!this.treeOutline) |
768 return;var width=this.splitView.element.offsetWidth;if(this.splitView.isVertical
()) | 771 return;var width=this.splitView.element.offsetWidth;if(this.splitView.isVertical
()) |
769 width-=this.splitView.sidebarWidth();this.treeOutline.setVisibleWidth(width);},g
et statusBarItems() | 772 width-=this.splitView.sidebarWidth();this.treeOutline.setVisibleWidth(width);thi
s.updateBreadcrumbSizes();},defaultFocusedElement:function() |
770 {return[this.crumbsElement];},defaultFocusedElement:function() | |
771 {return this.treeOutline.element;},statusBarResized:function() | 773 {return this.treeOutline.element;},statusBarResized:function() |
772 {this.updateBreadcrumbSizes();},wasShown:function() | 774 {this.updateBreadcrumbSizes();},wasShown:function() |
773 {if(this.treeOutline.element.parentElement!==this.contentElement) | 775 {if(this.treeOutline.element.parentElement!==this.contentElement) |
774 this.contentElement.appendChild(this.treeOutline.element);WebInspector.Panel.pro
totype.wasShown.call(this);this.updateBreadcrumb();this.treeOutline.updateSelect
ion();this.treeOutline.setVisible(true);if(!this.treeOutline.rootDOMNode) | 776 this.contentElement.appendChild(this.treeOutline.element);WebInspector.Panel.pro
totype.wasShown.call(this);this.updateBreadcrumb();this.treeOutline.updateSelect
ion();this.treeOutline.setVisible(true);if(!this.treeOutline.rootDOMNode) |
775 WebInspector.domAgent.requestDocument();},willHide:function() | 777 WebInspector.domAgent.requestDocument();},willHide:function() |
776 {WebInspector.domAgent.hideDOMNodeHighlight();this.treeOutline.setVisible(false)
;this._popoverHelper.hidePopover();this.contentElement.removeChild(this.treeOutl
ine.element);WebInspector.Panel.prototype.willHide.call(this);},onResize:functio
n() | 778 {WebInspector.domAgent.hideDOMNodeHighlight();this.treeOutline.setVisible(false)
;this._popoverHelper.hidePopover();this.contentElement.removeChild(this.treeOutl
ine.element);WebInspector.Panel.prototype.willHide.call(this);},onResize:functio
n() |
777 {this.treeOutline.updateSelection();this.updateBreadcrumbSizes();},_setPseudoCla
ssForNodeId:function(nodeId,pseudoClass,enable) | 779 {this.treeOutline.updateSelection();this.updateBreadcrumbSizes();},createView:fu
nction(id) |
| 780 {if(!this._overridesView) |
| 781 this._overridesView=new WebInspector.OverridesView();return this._overridesView;
},_setPseudoClassForNodeId:function(nodeId,pseudoClass,enable) |
778 {var node=WebInspector.domAgent.nodeForId(nodeId);if(!node) | 782 {var node=WebInspector.domAgent.nodeForId(nodeId);if(!node) |
779 return;var pseudoClasses=node.getUserProperty(WebInspector.ElementsTreeOutline.P
seudoStateDecorator.PropertyName);if(enable){pseudoClasses=pseudoClasses||[];if(
pseudoClasses.indexOf(pseudoClass)>=0) | 783 return;var pseudoClasses=node.getUserProperty(WebInspector.ElementsTreeOutline.P
seudoStateDecorator.PropertyName);if(enable){pseudoClasses=pseudoClasses||[];if(
pseudoClasses.indexOf(pseudoClass)>=0) |
780 return;pseudoClasses.push(pseudoClass);node.setUserProperty(WebInspector.Element
sTreeOutline.PseudoStateDecorator.PropertyName,pseudoClasses);}else{if(!pseudoCl
asses||pseudoClasses.indexOf(pseudoClass)<0) | 784 return;pseudoClasses.push(pseudoClass);node.setUserProperty(WebInspector.Element
sTreeOutline.PseudoStateDecorator.PropertyName,pseudoClasses);}else{if(!pseudoCl
asses||pseudoClasses.indexOf(pseudoClass)<0) |
781 return;pseudoClasses.remove(pseudoClass);if(!pseudoClasses.length) | 785 return;pseudoClasses.remove(pseudoClass);if(!pseudoClasses.length) |
782 node.removeUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.Pr
opertyName);} | 786 node.removeUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecorator.Pr
opertyName);} |
783 this.treeOutline.updateOpenCloseTags(node);WebInspector.cssModel.forcePseudoStat
e(node.id,node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecor
ator.PropertyName));this._metricsPaneEdited();this._stylesPaneEdited();WebInspec
tor.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction,{
action:WebInspector.UserMetrics.UserActionNames.ForcedElementState,selector:node
.appropriateSelectorFor(false),enabled:enable,state:pseudoClass});},_selectedNod
eChanged:function() | 787 this.treeOutline.updateOpenCloseTags(node);WebInspector.cssModel.forcePseudoStat
e(node.id,node.getUserProperty(WebInspector.ElementsTreeOutline.PseudoStateDecor
ator.PropertyName));this._metricsPaneEdited();this._stylesPaneEdited();WebInspec
tor.notifications.dispatchEventToListeners(WebInspector.UserMetrics.UserAction,{
action:WebInspector.UserMetrics.UserActionNames.ForcedElementState,selector:node
.appropriateSelectorFor(false),enabled:enable,state:pseudoClass});},_selectedNod
eChanged:function() |
784 {var selectedNode=this.selectedDOMNode();if(!selectedNode&&this._lastValidSelect
edNode) | 788 {var selectedNode=this.selectedDOMNode();if(!selectedNode&&this._lastValidSelect
edNode) |
785 this._selectedPathOnReset=this._lastValidSelectedNode.path();this.updateBreadcru
mb(false);this._updateSidebars();if(selectedNode){ConsoleAgent.addInspectedNode(
selectedNode.id);this._lastValidSelectedNode=selectedNode;} | 789 this._selectedPathOnReset=this._lastValidSelectedNode.path();this.updateBreadcru
mb(false);this._updateSidebars();if(selectedNode){ConsoleAgent.addInspectedNode(
selectedNode.id);this._lastValidSelectedNode=selectedNode;} |
786 WebInspector.notifications.dispatchEventToListeners(WebInspector.ElementsTreeOut
line.Events.SelectedNodeChanged);},_updateSidebars:function() | 790 WebInspector.notifications.dispatchEventToListeners(WebInspector.ElementsTreeOut
line.Events.SelectedNodeChanged);},_updateSidebars:function() |
787 {for(var pane in this.sidebarPanes) | 791 {for(var pane in this.sidebarPanes) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 return;var crumbs=this.crumbsElement;var handled=false;var crumb=crumbs.firstChi
ld;while(crumb){if(crumb.representedObject===this.selectedDOMNode()){crumb.addSt
yleClass("selected");handled=true;}else{crumb.removeStyleClass("selected");} | 869 return;var crumbs=this.crumbsElement;var handled=false;var crumb=crumbs.firstChi
ld;while(crumb){if(crumb.representedObject===this.selectedDOMNode()){crumb.addSt
yleClass("selected");handled=true;}else{crumb.removeStyleClass("selected");} |
866 crumb=crumb.nextSibling;} | 870 crumb=crumb.nextSibling;} |
867 if(handled&&!forceUpdate){this.updateBreadcrumbSizes();return;} | 871 if(handled&&!forceUpdate){this.updateBreadcrumbSizes();return;} |
868 crumbs.removeChildren();var panel=this;function selectCrumbFunction(event) | 872 crumbs.removeChildren();var panel=this;function selectCrumbFunction(event) |
869 {var crumb=event.currentTarget;if(crumb.hasStyleClass("collapsed")){if(crumb===p
anel.crumbsElement.firstChild){var currentCrumb=crumb;while(currentCrumb){var hi
dden=currentCrumb.hasStyleClass("hidden");var collapsed=currentCrumb.hasStyleCla
ss("collapsed");if(!hidden&&!collapsed) | 873 {var crumb=event.currentTarget;if(crumb.hasStyleClass("collapsed")){if(crumb===p
anel.crumbsElement.firstChild){var currentCrumb=crumb;while(currentCrumb){var hi
dden=currentCrumb.hasStyleClass("hidden");var collapsed=currentCrumb.hasStyleCla
ss("collapsed");if(!hidden&&!collapsed) |
870 break;crumb=currentCrumb;currentCrumb=currentCrumb.nextSibling;}} | 874 break;crumb=currentCrumb;currentCrumb=currentCrumb.nextSibling;}} |
871 panel.updateBreadcrumbSizes(crumb);}else | 875 panel.updateBreadcrumbSizes(crumb);}else |
872 panel.selectDOMNode(crumb.representedObject,true);event.preventDefault();} | 876 panel.selectDOMNode(crumb.representedObject,true);event.preventDefault();} |
873 for(var current=this.selectedDOMNode();current;current=current.parentNode){if(cu
rrent.nodeType()===Node.DOCUMENT_NODE) | 877 for(var current=this.selectedDOMNode();current;current=current.parentNode){if(cu
rrent.nodeType()===Node.DOCUMENT_NODE) |
874 continue;crumb=document.createElement("span");crumb.className="crumb";crumb.repr
esentedObject=current;crumb.addEventListener("mousedown",selectCrumbFunction,fal
se);var crumbTitle="";switch(current.nodeType()){case Node.ELEMENT_NODE:if(curre
nt.pseudoType()) | 878 continue;crumb=document.createElement("span");crumb.className="crumb";crumb.repr
esentedObject=current;crumb.addEventListener("mousedown",selectCrumbFunction,fal
se);var crumbTitle="";switch(current.nodeType()){case Node.ELEMENT_NODE:if(curre
nt.pseudoType()) |
875 crumbTitle=":"+current.pseudoType();else | 879 crumbTitle="::"+current.pseudoType();else |
876 WebInspector.DOMPresentationUtils.decorateNodeLabel(current,crumb);break;case No
de.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();} | 880 WebInspector.DOMPresentationUtils.decorateNodeLabel(current,crumb);break;case No
de.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();} |
877 if(!crumb.childNodes.length){var nameElement=document.createElement("span");name
Element.textContent=crumbTitle;crumb.appendChild(nameElement);crumb.title=crumbT
itle;} | 881 if(!crumb.childNodes.length){var nameElement=document.createElement("span");name
Element.textContent=crumbTitle;crumb.appendChild(nameElement);crumb.title=crumbT
itle;} |
878 if(current===this.selectedDOMNode()) | 882 if(current===this.selectedDOMNode()) |
879 crumb.addStyleClass("selected");if(!crumbs.childNodes.length) | 883 crumb.addStyleClass("selected");if(!crumbs.childNodes.length) |
880 crumb.addStyleClass("end");crumbs.appendChild(crumb);} | 884 crumb.addStyleClass("end");crumbs.insertBefore(crumb,crumbs.firstChild);} |
881 if(crumbs.hasChildNodes()) | 885 if(crumbs.hasChildNodes()) |
882 crumbs.lastChild.addStyleClass("start");this.updateBreadcrumbSizes();},updateBre
adcrumbSizes:function(focusedCrumb) | 886 crumbs.lastChild.addStyleClass("start");this.updateBreadcrumbSizes();},updateBre
adcrumbSizes:function(focusedCrumb) |
883 {if(!this.isShowing()) | 887 {if(!this.isShowing()) |
884 return;if(document.body.offsetWidth<=0){return;} | 888 return;if(document.body.offsetWidth<=0){return;} |
885 var crumbs=this.crumbsElement;if(!crumbs.childNodes.length||crumbs.offsetWidth<=
0) | 889 var crumbs=this.crumbsElement;if(!crumbs.childNodes.length||crumbs.offsetWidth<=
0) |
886 return;var selectedIndex=0;var focusedIndex=0;var selectedCrumb;var i=0;var crum
b=crumbs.firstChild;while(crumb){if(!selectedCrumb&&crumb.hasStyleClass("selecte
d")){selectedCrumb=crumb;selectedIndex=i;} | 890 return;var selectedIndex=0;var focusedIndex=0;var selectedCrumb;var i=0;var crum
b=crumbs.firstChild;while(crumb){if(!selectedCrumb&&crumb.hasStyleClass("selecte
d")){selectedCrumb=crumb;selectedIndex=i;} |
887 if(crumb===focusedCrumb) | 891 if(crumb===focusedCrumb) |
888 focusedIndex=i;if(crumb!==crumbs.lastChild) | 892 focusedIndex=i;if(crumb!==crumbs.lastChild) |
889 crumb.removeStyleClass("start");if(crumb!==crumbs.firstChild) | 893 crumb.removeStyleClass("start");if(crumb!==crumbs.firstChild) |
890 crumb.removeStyleClass("end");crumb.removeStyleClass("compact");crumb.removeStyl
eClass("collapsed");crumb.removeStyleClass("hidden");crumb=crumb.nextSibling;++i
;} | 894 crumb.removeStyleClass("end");crumb.removeStyleClass("compact");crumb.removeStyl
eClass("collapsed");crumb.removeStyleClass("hidden");crumb=crumb.nextSibling;++i
;} |
891 crumbs.firstChild.addStyleClass("end");crumbs.lastChild.addStyleClass("start");v
ar rightPadding=20;var crumbsTotalOffsetLeft=crumbs.totalOffsetLeft();var window
InnerWidth=window.innerWidth;var errorWarningElement=document.getElementById("er
ror-warning-count");if(!WebInspector.drawer.visible){if(errorWarningElement) | 895 crumbs.firstChild.addStyleClass("end");crumbs.lastChild.addStyleClass("start");v
ar contentElement=this.contentElement;function crumbsAreSmallerThanContainer() |
892 rightPadding+=errorWarningElement.offsetWidth;rightPadding+=WebInspector.setting
sController.statusBarItem.offsetWidth;} | 896 {const rightPadding=10;return crumbs.offsetWidth+rightPadding<contentElement.off
setWidth;} |
893 function crumbsAreSmallerThanContainer() | |
894 {return(crumbsTotalOffsetLeft+crumbs.offsetWidth+rightPadding)<windowInnerWidth;
} | |
895 if(crumbsAreSmallerThanContainer()) | 897 if(crumbsAreSmallerThanContainer()) |
896 return;var BothSides=0;var AncestorSide=-1;var ChildSide=1;function makeCrumbsSm
aller(shrinkingFunction,direction,significantCrumb) | 898 return;var BothSides=0;var AncestorSide=-1;var ChildSide=1;function makeCrumbsSm
aller(shrinkingFunction,direction,significantCrumb) |
897 {if(!significantCrumb) | 899 {if(!significantCrumb) |
898 significantCrumb=(focusedCrumb||selectedCrumb);if(significantCrumb===selectedCru
mb) | 900 significantCrumb=(focusedCrumb||selectedCrumb);if(significantCrumb===selectedCru
mb) |
899 var significantIndex=selectedIndex;else if(significantCrumb===focusedCrumb) | 901 var significantIndex=selectedIndex;else if(significantCrumb===focusedCrumb) |
900 var significantIndex=focusedIndex;else{var significantIndex=0;for(var i=0;i<crum
bs.childNodes.length;++i){if(crumbs.childNodes[i]===significantCrumb){significan
tIndex=i;break;}}} | 902 var significantIndex=focusedIndex;else{var significantIndex=0;for(var i=0;i<crum
bs.childNodes.length;++i){if(crumbs.childNodes[i]===significantCrumb){significan
tIndex=i;break;}}} |
901 function shrinkCrumbAtIndex(index) | 903 function shrinkCrumbAtIndex(index) |
902 {var shrinkCrumb=crumbs.childNodes[index];if(shrinkCrumb&&shrinkCrumb!==signific
antCrumb) | 904 {var shrinkCrumb=crumbs.childNodes[index];if(shrinkCrumb&&shrinkCrumb!==signific
antCrumb) |
903 shrinkingFunction(shrinkCrumb);if(crumbsAreSmallerThanContainer()) | 905 shrinkingFunction(shrinkCrumb);if(crumbsAreSmallerThanContainer()) |
904 return true;return false;} | 906 return true;return false;} |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 commandCallback=revealElement.bind(this,remoteObject);}else if(target instanceof
WebInspector.DOMNode){var domNode=(target);if(domNode.id) | 968 commandCallback=revealElement.bind(this,remoteObject);}else if(target instanceof
WebInspector.DOMNode){var domNode=(target);if(domNode.id) |
967 commandCallback=WebInspector.domAgent.inspectElement.bind(WebInspector.domAgent,
domNode.id);} | 969 commandCallback=WebInspector.domAgent.inspectElement.bind(WebInspector.domAgent,
domNode.id);} |
968 if(!commandCallback) | 970 if(!commandCallback) |
969 return;if(this.treeOutline.element.isAncestor(event.target)) | 971 return;if(this.treeOutline.element.isAncestor(event.target)) |
970 return;contextMenu.appendItem(WebInspector.useLowerCaseMenuTitles()?"Reveal in E
lements panel":"Reveal in Elements Panel",commandCallback);},_sidebarContextMenu
EventFired:function(event) | 972 return;contextMenu.appendItem(WebInspector.useLowerCaseMenuTitles()?"Reveal in E
lements panel":"Reveal in Elements Panel",commandCallback);},_sidebarContextMenu
EventFired:function(event) |
971 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.show();},_dockS
ideChanged:function() | 973 {var contextMenu=new WebInspector.ContextMenu(event);contextMenu.show();},_dockS
ideChanged:function() |
972 {var dockSide=WebInspector.dockController.dockSide();var vertically=dockSide===W
ebInspector.DockController.State.DockedToRight&&WebInspector.settings.splitVerti
callyWhenDockedToRight.get();this._splitVertically(vertically);},_showShadowDOMC
hanged:function() | 974 {var dockSide=WebInspector.dockController.dockSide();var vertically=dockSide===W
ebInspector.DockController.State.DockedToRight&&WebInspector.settings.splitVerti
callyWhenDockedToRight.get();this._splitVertically(vertically);},_showShadowDOMC
hanged:function() |
973 {this.treeOutline.update();},_splitVertically:function(vertically) | 975 {this.treeOutline.update();},_splitVertically:function(vertically) |
974 {if(this.sidebarPaneView&&vertically===!this.splitView.isVertical()) | 976 {if(this.sidebarPaneView&&vertically===!this.splitView.isVertical()) |
975 return;if(this.sidebarPaneView) | 977 return;if(this.sidebarPaneView) |
976 this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);var comput
edPane=new WebInspector.SidebarPane(WebInspector.UIString("Computed"));computedP
ane.element.addStyleClass("composite");computedPane.element.addStyleClass("fill"
);var expandComputed=computedPane.expand.bind(computedPane);computedPane.bodyEle
ment.appendChild(this.sidebarPanes.computedStyle.titleElement);computedPane.body
Element.addStyleClass("metrics-and-computed");this.sidebarPanes.computedStyle.sh
ow(computedPane.bodyElement);this.sidebarPanes.computedStyle.setExpandCallback(e
xpandComputed);this.sidebarPanes.platformFonts.show(computedPane.bodyElement);if
(vertically){this.sidebarPanes.metrics.show(computedPane.bodyElement,this.sideba
rPanes.computedStyle.element);this.sidebarPanes.metrics.setExpandCallback(expand
Computed);this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var composit
ePane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());compositePa
ne.element.addStyleClass("composite");compositePane.element.addStyleClass("fill"
);var expandComposite=compositePane.expand.bind(compositePane);var splitView=new
WebInspector.SplitView(true,"StylesPaneSplitRatio",0.5);splitView.show(composit
ePane.bodyElement);this.sidebarPanes.styles.show(splitView.firstElement());split
View.firstElement().appendChild(this.sidebarPanes.styles.titleElement);this.side
barPanes.styles.setExpandCallback(expandComposite);computedPane.show(splitView.s
econdElement());computedPane.setExpandCallback(expandComposite);this.sidebarPane
View.addPane(compositePane);this.sidebarPaneView.addPane(this.sidebarPanes.prope
rties);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sideb
arPaneView.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.bin
d(stylesPane);stylesPane.bodyElement.addStyleClass("metrics-and-styles");this.si
debarPanes.styles.show(stylesPane.bodyElement);this.sidebarPanes.styles.setExpan
dCallback(expandStyles);this.sidebarPanes.metrics.setExpandCallback(expandStyles
);stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);func
tion showMetrics(pane,beforeElement) | 978 this.sidebarPaneView.detach();this.splitView.setVertical(!vertically);var comput
edPane=new WebInspector.SidebarPane(WebInspector.UIString("Computed"));computedP
ane.element.addStyleClass("composite");computedPane.element.addStyleClass("fill"
);var expandComputed=computedPane.expand.bind(computedPane);computedPane.bodyEle
ment.appendChild(this.sidebarPanes.computedStyle.titleElement);computedPane.body
Element.addStyleClass("metrics-and-computed");this.sidebarPanes.computedStyle.sh
ow(computedPane.bodyElement);this.sidebarPanes.computedStyle.setExpandCallback(e
xpandComputed);this.sidebarPanes.platformFonts.show(computedPane.bodyElement);if
(vertically){this.sidebarPanes.metrics.show(computedPane.bodyElement,this.sideba
rPanes.computedStyle.element);this.sidebarPanes.metrics.setExpandCallback(expand
Computed);this.sidebarPaneView=new WebInspector.SidebarTabbedPane();var composit
ePane=new WebInspector.SidebarPane(this.sidebarPanes.styles.title());compositePa
ne.element.addStyleClass("composite");compositePane.element.addStyleClass("fill"
);var expandComposite=compositePane.expand.bind(compositePane);var splitView=new
WebInspector.SplitView(true,"StylesPaneSplitRatio",0.5);splitView.show(composit
ePane.bodyElement);this.sidebarPanes.styles.show(splitView.firstElement());split
View.firstElement().appendChild(this.sidebarPanes.styles.titleElement);this.side
barPanes.styles.setExpandCallback(expandComposite);computedPane.show(splitView.s
econdElement());computedPane.setExpandCallback(expandComposite);this.sidebarPane
View.addPane(compositePane);this.sidebarPaneView.addPane(this.sidebarPanes.prope
rties);this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);this.sideb
arPaneView.addPane(this.sidebarPanes.eventListeners);this._extensionSidebarPanes
Container=this.sidebarPaneView;}else{this.sidebarPaneView=new WebInspector.Sideb
arTabbedPane();var stylesPane=new WebInspector.SidebarPane(this.sidebarPanes.sty
les.title());stylesPane.element.addStyleClass("composite");stylesPane.element.ad
dStyleClass("fill");var expandStyles=stylesPane.expand.bind(stylesPane);stylesPa
ne.bodyElement.addStyleClass("metrics-and-styles");this.sidebarPanes.styles.show
(stylesPane.bodyElement);this.sidebarPanes.styles.setExpandCallback(expandStyles
);this.sidebarPanes.metrics.setExpandCallback(expandStyles);stylesPane.bodyEleme
nt.appendChild(this.sidebarPanes.styles.titleElement);function showMetrics(pane,
beforeElement) |
977 {this.sidebarPanes.metrics.show(pane.bodyElement,beforeElement);} | 979 {this.sidebarPanes.metrics.show(pane.bodyElement,beforeElement);} |
978 function tabSelected(event) | 980 function tabSelected(event) |
979 {var tabId=(event.data.tabId);if(tabId===computedPane.title()) | 981 {var tabId=(event.data.tabId);if(tabId===computedPane.title()) |
980 showMetrics.call(this,computedPane,this.sidebarPanes.computedStyle.element);if(t
abId===stylesPane.title()) | 982 showMetrics.call(this,computedPane,this.sidebarPanes.computedStyle.element);if(t
abId===stylesPane.title()) |
981 showMetrics.call(this,stylesPane);} | 983 showMetrics.call(this,stylesPane);} |
982 this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted,tabSelected,this);showMetrics.call(this,stylesPane);this.sidebarPaneView.ad
dPane(stylesPane);this.sidebarPaneView.addPane(computedPane);this.sidebarPaneVie
w.addPane(this.sidebarPanes.eventListeners);this.sidebarPaneView.addPane(this.si
debarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.proper
ties);} | 984 this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted,tabSelected,this);showMetrics.call(this,stylesPane);this.sidebarPaneView.ad
dPane(stylesPane);this.sidebarPaneView.addPane(computedPane);this.sidebarPaneVie
w.addPane(this.sidebarPanes.eventListeners);this.sidebarPaneView.addPane(this.si
debarPanes.domBreakpoints);this.sidebarPaneView.addPane(this.sidebarPanes.proper
ties);this._extensionSidebarPanesContainer=this.sidebarPaneView;} |
983 this.sidebarPaneView.show(this.splitView.sidebarElement);this.sidebarPanes.style
s.expand();},addExtensionSidebarPane:function(id,pane) | 985 for(var i=0;i<this._extensionSidebarPanes.length;++i) |
984 {this.sidebarPanes[id]=pane;this.sidebarPaneView.addPane(pane);},__proto__:WebIn
spector.Panel.prototype} | 986 this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);thi
s.sidebarPaneView.show(this.splitView.sidebarElement);this.sidebarPanes.styles.e
xpand();},addExtensionSidebarPane:function(id,pane) |
| 987 {this._extensionSidebarPanes.push(pane);this._extensionSidebarPanesContainer.add
Pane(pane);},__proto__:WebInspector.Panel.prototype} |
OLD | NEW |