private void collapseEmptySubtreeMargins(LayoutContext c, MarginCollapseResult result) { RectPropertySet margin = getMargin(c); result.update((int) margin.top()); result.update((int) margin.bottom()); setMarginTop(c, 0); setTopMarginCalculated(true); setMarginBottom(c, 0); setBottomMarginCalculated(true); ensureChildren(c); if (getChildrenContentType() == CONTENT_BLOCK) { for (Iterator i = getChildIterator(); i.hasNext();) { BlockBox child = (BlockBox) i.next(); child.collapseEmptySubtreeMargins(c, result); } } }
private void collapseEmptySubtreeMargins(LayoutContext c, MarginCollapseResult result) { RectPropertySet margin = getMargin(c); result.update((int) margin.top()); result.update((int) margin.bottom()); setMarginTop(c, 0); setTopMarginCalculated(true); setMarginBottom(c, 0); setBottomMarginCalculated(true); ensureChildren(c); if (getChildrenContentType() == CONTENT_BLOCK) { for (Iterator i = getChildIterator(); i.hasNext();) { BlockBox child = (BlockBox) i.next(); child.collapseEmptySubtreeMargins(c, result); } } }
private void collapseTopMargin( LayoutContext c, boolean calculationRoot, MarginCollapseResult result) { if (! isTopMarginCalculated()) { if (! isSkipWhenCollapsingMargins()) { calcDimensions(c); RectPropertySet margin = getMargin(c); result.update((int) margin.top()); if (! calculationRoot && (int) margin.top() != 0) { setMarginTop(c, 0); } if (isMayCollapseMarginsWithChildren() && isNoTopPaddingOrBorder(c)) { ensureChildren(c); if (getChildrenContentType() == CONTENT_BLOCK) { for (Iterator i = getChildIterator(); i.hasNext();) { BlockBox child = (BlockBox) i.next(); child.collapseTopMargin(c, false, result); if (child.isSkipWhenCollapsingMargins()) { continue; } break; } } } } setTopMarginCalculated(true); } }
private void collapseTopMargin( LayoutContext c, boolean calculationRoot, MarginCollapseResult result) { if (! isTopMarginCalculated()) { if (! isSkipWhenCollapsingMargins()) { calcDimensions(c); RectPropertySet margin = getMargin(c); result.update((int) margin.top()); if (! calculationRoot && (int) margin.top() != 0) { setMarginTop(c, 0); } if (isMayCollapseMarginsWithChildren() && isNoTopPaddingOrBorder(c)) { ensureChildren(c); if (getChildrenContentType() == CONTENT_BLOCK) { for (Iterator i = getChildIterator(); i.hasNext();) { BlockBox child = (BlockBox) i.next(); child.collapseTopMargin(c, false, result); if (child.isSkipWhenCollapsingMargins()) { continue; } break; } } } } setTopMarginCalculated(true); } }
public void reset(LayoutContext c) { super.reset(c); setTopMarginCalculated(false); setBottomMarginCalculated(false); setDimensionsCalculated(false); setMinMaxCalculated(false); setChildrenHeight(0); if (isReplaced()) { getReplacedElement().detach(c); setReplacedElement(null); } if (getChildrenContentType() == BlockBox.CONTENT_INLINE) { removeAllChildren(); } if (isFloated()) { _floatedBoxData.getManager().removeFloat(this); } if (getStyle().isRunning()) { c.getRootLayer().removeRunningBlock(this); } }
public void reset(LayoutContext c) { super.reset(c); setTopMarginCalculated(false); setBottomMarginCalculated(false); setDimensionsCalculated(false); setMinMaxCalculated(false); setChildrenHeight(0); if (isReplaced()) { getReplacedElement().detach(c); setReplacedElement(null); } if (getChildrenContentType() == BlockBox.CONTENT_INLINE) { removeAllChildren(); } if (isFloated()) { _floatedBoxData.getManager().removeFloat(this); _floatedBoxData.getDrawingLayer().removeFloat(this); } if (getStyle().isRunning()) { c.getRootLayer().removeRunningBlock(this); } }