B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
   * Update the rule editor with the contents of the rule.
   */
Update the rule editor with the contents of the rule.
Update the rule editor with the contents of the rule .
function RuleEditor_populate()
  {
    while (this.selectorText.hasChildNodes()) {
      this.selectorText.removeChild(this.selectorText.lastChild);
    }
    if (this.rule.domRule && this.rule.domRule.selectorText) {
      let selectors = CssLogic.getSelectors(this.rule.selectorText);
      let element = this.rule.inherited || this.ruleView._viewedElement;
      for (let i = 0; i < selectors.length; i++) {
        let selector = selectors[i];
        if (i != 0) {
          createChild(this.selectorText, "span", {
            class: "ruleview-selector-separator",
            textContent: ", "
          });
        }
        let cls = element.mozMatchesSelector(selector) ? "ruleview-selector-matched" : "ruleview-selector-unmatched";
        createChild(this.selectorText, "span", {
          class: cls,
          textContent: selector
        });
      }
    } else {
      this.selectorText.textContent = this.rule.selectorText;
    }
    for (let prop of this.rule.textProps) {
      if (!prop.editor) {
        new TextPropertyEditor(this, prop);
        this.propertyList.appendChild(prop.editor.element);
      }
    }
  }
function RuleEditor_populate ( ) { while ( this . selectorText . hasChildNodes ( ) ) { this . selectorText . removeChild ( this . selectorText . lastChild ) ; } if ( this . rule . domRule && this . rule . domRule . selectorText ) { let selectors = CssLogic . getSelectors ( this . rule . selectorText ) ; let element = this . rule . inherited || this . ruleView . _viewedElement ; for ( let i = 0 ; i < selectors . length ; i ++ ) { let selector = selectors [ i ] ; if ( i != 0 ) { createChild ( this . selectorText , "span" , { class : "ruleview-selector-separator" , textContent : ", " } ) ; } let cls = element . mozMatchesSelector ( selector ) ? "ruleview-selector-matched" : "ruleview-selector-unmatched" ; createChild ( this . selectorText , "span" , { class : cls , textContent : selector } ) ; } } else { this . selectorText . textContent = this . rule . selectorText ; } for ( let prop of this . rule . textProps ) { if ( ! prop . editor ) { new TextPropertyEditor ( this , prop ) ; this . propertyList . appendChild ( prop . editor . element ) ; } } }
Update the rule editor with the contents of the rule.
Update the rule editor with the contents of the rule .
// Clear out existing viewers. // If selector text comes from a css rule, highlight selectors that // actually match.  For custom selector text (such as for the 'element' // style, just show the text directly.