B2G/gecko/accessible/tests/mochitest/attributes.js
/**
 * Build an object of default text attributes expected for the given accessible.
 *
 * @param aID          [in] identifier of accessible
 * @param aFontSize    [in] font size
 * @param aFontWeight  [in, optional] kBoldFontWeight or kNormalFontWeight,
 *                      default value is kNormalFontWeight
 */
Build an object of default text attributes expected for the given accessible.
@param aID          [in] identifier of accessible
@param aFontSize    [in] font size
@param aFontWeight  [in, optional] kBoldFontWeight or kNormalFontWeight,
default value is kNormalFontWeight
Build an object of default text attributes expected for the given accessible . @param aID [ in ] identifier of accessible @param aFontSize [ in ] font size @param aFontWeight [ in optional ] kBoldFontWeight or kNormalFontWeight default value is kNormalFontWeight
function buildDefaultTextAttrs(aID, aFontSize, aFontWeight, aFontFamily)
{
  var elm = getNode(aID);
  var computedStyle = document.defaultView.getComputedStyle(elm, "");
  var bgColor = computedStyle.backgroundColor == "transparent" ?
    "rgb(255, 255, 255)" : computedStyle.backgroundColor;
  var defAttrs = {
    "font-style": computedStyle.fontStyle,
    "font-size": aFontSize,
    "background-color": bgColor,
    "font-weight": aFontWeight ? aFontWeight : kNormalFontWeight,
    "color": computedStyle.color,
    "font-family": aFontFamily ? aFontFamily : fontFamily(computedStyle),
    "text-position": computedStyle.verticalAlign
  };
  return defAttrs;
}
function buildDefaultTextAttrs ( aID , aFontSize , aFontWeight , aFontFamily ) { var elm = getNode ( aID ) ; var computedStyle = document . defaultView . getComputedStyle ( elm , "" ) ; var bgColor = computedStyle . backgroundColor == "transparent" ? "rgb(255, 255, 255)" : computedStyle . backgroundColor ; var defAttrs = { "font-style" : computedStyle . fontStyle , "font-size" : aFontSize , "background-color" : bgColor , "font-weight" : aFontWeight ? aFontWeight : kNormalFontWeight , "color" : computedStyle . color , "font-family" : aFontFamily ? aFontFamily : fontFamily ( computedStyle ) , "text-position" : computedStyle . verticalAlign } ; return defAttrs ; }
Build an object of default text attributes expected for the given accessible.
Build an object of default text attributes expected for the given accessible .