B2G/gecko/browser/devtools/styleinspector/CssLogic.jsm
/**
   * Check if the highlighted element or it's parents have matched selectors.
   *
   * @param {array} aProperties The list of properties you want to check if they
   * have matched selectors or not.
   * @return {object} An object that tells for each property if it has matched
   * selectors or not. Object keys are property names and values are booleans.
   */
Check if the highlighted element or it's parents have matched selectors.
@param {array} aProperties The list of properties you want to check if they
have matched selectors or not.
@return {object} An object that tells for each property if it has matched
selectors or not. Object keys are property names and values are booleans.
Check if the highlighted element or it ' s parents have matched selectors . @param { array } aProperties The list of properties you want to check if they have matched selectors or not . @return { object } An object that tells for each property if it has matched selectors or not . Object keys are property names and values are booleans .
function CL_hasMatchedSelectors(aProperties)
  {
    if (!this._matchedRules) {
      this._buildMatchedRules();
    }
    let result = {};
    this._matchedRules.some(function(aValue) {
      let rule = aValue[0];
      let status = aValue[1];
      aProperties = aProperties.filter(function(aProperty) {
        if (rule.getPropertyValue(aProperty) &&
            (status == CssLogic.STATUS.MATCHED ||
             (status == CssLogic.STATUS.PARENT_MATCH &&
              this.domUtils.isInheritedProperty(aProperty)))) {
          result[aProperty] = true;
          return false;
        }
        return true; 
      }.bind(this));
      return aProperties.length == 0;
    }, this);
    return result;
  }
function CL_hasMatchedSelectors ( aProperties ) { if ( ! this . _matchedRules ) { this . _buildMatchedRules ( ) ; } let result = { } ; this . _matchedRules . some ( function ( aValue ) { let rule = aValue [ 0 ] ; let status = aValue [ 1 ] ; aProperties = aProperties . filter ( function ( aProperty ) { if ( rule . getPropertyValue ( aProperty ) && ( status == CssLogic . STATUS . MATCHED || ( status == CssLogic . STATUS . PARENT_MATCH && this . domUtils . isInheritedProperty ( aProperty ) ) ) ) { result [ aProperty ] = true ; return false ; } return true ; } . bind ( this ) ) ; return aProperties . length == 0 ; } , this ) ; return result ; }
Check if the highlighted element or it's parents have matched selectors.
Check if the highlighted element or it ' s parents have matched selectors .
// We just need to find if a rule has this property while it matches // the viewedElement (or its parents). // Keep the property for the next rule.