PRBool isHorizontal = mParentBox->IsHorizontal(); AdjustChildren(aPresContext, mChildInfosBefore, mChildInfosBeforeCount, isHorizontal); AdjustChildren(aPresContext, mChildInfosAfter, mChildInfosAfterCount, isHorizontal);  nsCOMPtr<nsIPresShell> shell; aPresContext->GetShell(getter_AddRefs(shell));  nsCOMPtr<nsIReflowCommand> reflowCmd; nsresult rv = NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), mParentBox, nsIReflowCommand::StyleChanged); if (NS_SUCCEEDED(rv)) shell->AppendReflowCommand(reflowCmd);
for (int i=0; i < aCount; i++) { nscoord   pref       = aChildInfos[i].changed; nsIFrame* childFrame = aChildInfos[i].child; PRInt32 index        = aChildInfos[i].index; nsresult rv;  const nsStyleSpacing* spacing; rv = childFrame->GetStyleData(eStyleStruct_Spacing, (const nsStyleStruct*&) spacing);  NS_ASSERTION(rv == NS_OK,"failed to get spacing info");  nsMargin margin(0,0,0,0); spacing->GetMargin(margin); nsMargin border(0,0,0,0); spacing->GetBorderPadding(border); margin += border;  nsIAtom* attribute;  if (aIsHorizontal) { pref -= (margin.left + margin.right); attribute = nsHTMLAtoms::width; } else { pref -= (margin.top + margin.bottom); attribute = nsHTMLAtoms::height; }  float p2t; aPresContext->GetScaledPixelsToTwips(&p2t); nscoord onePixel = NSIntPixelsToTwips(1, p2t);  nsCOMPtr<nsIContent> content; childFrame->GetContent(getter_AddRefs(content));   char ch[50]; sprintf(ch,"%d",pref/onePixel);  content->SetAttribute(kNameSpaceID_None, attribute, ch, PR_FALSE); mParentBox->InvalidateCache(childFrame); }
nsSplitterFrameImpl::AdjustChildren(nsIPresContext* aPresContext){  PRBool isHorizontal = mParentBox->IsHorizontal();  AdjustChildren(aPresContext, mChildInfosBefore, mChildInfosBeforeCount, isHorizontal);  AdjustChildren(aPresContext, mChildInfosAfter, mChildInfosAfterCount, isHorizontal);     nsCOMPtr<nsIPresShell> shell;  aPresContext->GetShell(getter_AddRefs(shell));    nsCOMPtr<nsIReflowCommand> reflowCmd;  nsresult rv = NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), mParentBox,                                        nsIReflowCommand::StyleChanged);  if (NS_SUCCEEDED(rv))     shell->AppendReflowCommand(reflowCmd);}