nsHTMLValue borderValue; if (aAttributes->GetAttribute(nsHTMLAtoms::border, borderValue) == NS_CONTENT_ATTR_NOT_THERE) {   if (!aAttributes->GetAttr(nsHTMLAtoms::frame)) { return; } borderValue.SetIntValue(1, eHTMLUnit_Integer); }
const nsAttrValue* borderValue = aAttributes->GetAttr(nsHTMLAtoms::border); if (!borderValue && !aAttributes->GetAttr(nsHTMLAtoms::frame)) return;
MapTableBorderInto(const nsMappedAttributes* aAttributes,                   nsRuleData* aData, PRUint8 aBorderStyle){  nsHTMLValue borderValue;  if (aAttributes->GetAttribute(nsHTMLAtoms::border, borderValue) ==      NS_CONTENT_ATTR_NOT_THERE) {    // the absence of "border" with the presence of "frame" implies    // border = 1 pixel    if (!aAttributes->GetAttr(nsHTMLAtoms::frame)) {      return;    }    borderValue.SetIntValue(1, eHTMLUnit_Integer);  }  if (borderValue.GetUnit() != eHTMLUnit_Integer) {    // empty values of border get rules=all and frame=border    if (aData->mTableData) {      aData->mTableData->mRules.SetIntValue(NS_STYLE_TABLE_RULES_ALL, eCSSUnit_Enumerated);      aData->mTableData->mFrame.SetIntValue(NS_STYLE_TABLE_FRAME_BORDER, eCSSUnit_Enumerated);    }    borderValue.SetIntValue(1, eHTMLUnit_Integer);  }  else {    PRInt32 borderThickness = borderValue.GetIntValue();    if (0 != borderThickness) {      // border != 0 implies rules=all and frame=border      if (aData->mTableData) {        aData->mTableData->mRules.SetIntValue(NS_STYLE_TABLE_RULES_ALL, eCSSUnit_Enumerated);        aData->mTableData->mFrame.SetIntValue(NS_STYLE_TABLE_FRAME_BORDER, eCSSUnit_Enumerated);      }    }    else {      // border = 0 implies rules=none and frame=void      if (aData->mTableData) {        aData->mTableData->mRules.SetIntValue(NS_STYLE_TABLE_RULES_NONE, eCSSUnit_Enumerated);        aData->mTableData->mFrame.SetIntValue(NS_STYLE_TABLE_FRAME_NONE, eCSSUnit_Enumerated);      }    }  }  PRInt32 borderThickness = borderValue.GetIntValue();  if (aData->mMarginData) {    // by default, set all border sides to the specified width    if (aData->mMarginData->mBorderWidth.mLeft.GetUnit() == eCSSUnit_Null)      aData->mMarginData->mBorderWidth.mLeft.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);    if (aData->mMarginData->mBorderWidth.mRight.GetUnit() == eCSSUnit_Null)      aData->mMarginData->mBorderWidth.mRight.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);    if (aData->mMarginData->mBorderWidth.mTop.GetUnit() == eCSSUnit_Null)      aData->mMarginData->mBorderWidth.mTop .SetFloatValue((float)borderThickness, eCSSUnit_Pixel);    if (aData->mMarginData->mBorderWidth.mBottom.GetUnit() == eCSSUnit_Null)      aData->mMarginData->mBorderWidth.mBottom.SetFloatValue((float)borderThickness, eCSSUnit_Pixel);    // now account for the frame attribute    MapTableFrameInto(aAttributes, aData, aBorderStyle);  }}