static void FixUpStyleSizeFromDisplayandParentSize(HELEMENT_HANDLE hElem) { HTMLElement *pContainer; DisplayElement *pDisplay; int X, Y, W, H; int pX, pY, pW, pH; HELEMENT_HANDLE ParentElement; static int CallDepth = 0; if (CallDepth) return; CallDepth++; webc_ElementGetXYWHPosition(hElem, &X, &Y, &W, &H); if (H!=0||W!=0) return; pX=pY=pW=pH=0; ParentElement = webc_ElementGetParent(hElem); if (ParentElement) webc_ElementGetXYWHPosition(ParentElement, &pX, &pY, &pW, &pH); pContainer = (HTMLElement *)hElem; pDisplay = pContainer->GetDisplayElement(); if (pDisplay) { W =pDisplay->mRect.Width(); H= pDisplay->mRect.Height(); if (W!=1 && H!=1) { if (pW > W) W = pW; webc_ElementSetXYWHPosition(hElem, X, Y, W, H); } } CallDepth--; }