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); } } }
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); } }
private void collapseBottomMargin( LayoutContext c, boolean calculationRoot, MarginCollapseResult result) { if (! isBottomMarginCalculated()) { if (! isSkipWhenCollapsingMargins()) { calcDimensions(c); RectPropertySet margin = getMargin(c); result.update((int) margin.bottom()); if (! calculationRoot && (int) margin.bottom() != 0) { setMarginBottom(c, 0); } if (isMayCollapseMarginsWithChildren() && ! getStyle().isTable() && isNoBottomPaddingOrBorder(c)) { ensureChildren(c); if (getChildrenContentType() == CONTENT_BLOCK) { for (int i = getChildCount() - 1; i >= 0; i--) { BlockBox child = (BlockBox) getChild(i); if (child.isSkipWhenCollapsingMargins()) { continue; } child.collapseBottomMargin(c, false, result); break; } } } } setBottomMarginCalculated(true); } }
private void collapseBottomMargin( LayoutContext c, boolean calculationRoot, MarginCollapseResult result) { if (! isBottomMarginCalculated()) { if (! isSkipWhenCollapsingMargins()) { calcDimensions(c); RectPropertySet margin = getMargin(c); result.update((int) margin.bottom()); if (! calculationRoot && (int) margin.bottom() != 0) { setMarginBottom(c, 0); } if (isMayCollapseMarginsWithChildren() && ! getStyle().isTable() && isNoBottomPaddingOrBorder(c)) { ensureChildren(c); if (getChildrenContentType() == CONTENT_BLOCK) { for (int i = getChildCount() - 1; i >= 0; i--) { BlockBox child = (BlockBox) getChild(i); if (child.isSkipWhenCollapsingMargins()) { continue; } child.collapseBottomMargin(c, false, result); break; } } } } setBottomMarginCalculated(true); } }