private static void createAnonymousBlock(SharedContext c, Box parent, List inline, List savedParents) { WhitespaceStripper.stripInlineContent(inline); if (inline.size() > 0) { AnonymousBlockBox anon = new AnonymousBlockBox(parent.getElement()); anon.setStyle(parent.getStyle().createAnonymousStyle(IdentValue.BLOCK)); anon.setAnonymous(true); if (savedParents != null && savedParents.size() > 0) { anon.setOpenInlineBoxes(savedParents); } parent.addChild(anon); anon.setChildrenContentType(BlockBox.CONTENT_INLINE); anon.setInlineContent(inline); } }
public void layout(LayoutContext c) { layoutInlineChildren(c, 0, calcInitialBreakAtLine(c), true); }
public int getContentWidth() { return getContainingBlock().getContentWidth(); }
public void provideSiblingMarginToFloats(int margin) { for (Iterator i = getInlineContent().iterator(); i.hasNext(); ) { Styleable styleable = (Styleable)i.next(); if (styleable instanceof BlockBox) { BlockBox b = (BlockBox)styleable; if (b.isFloated()) { b.getFloatedBoxData().setMarginFromSibling(margin); } } } }
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) { Box result = super.find(cssCtx, absX, absY, findAnonymous); if (! findAnonymous && result == this) { return getParent(); } else { return result; } }
private BlockBox getNextCollapsableSibling(MarginCollapseResult collapsedMargin) { BlockBox next = (BlockBox) getNextSibling(); while (next != null) { if (next instanceof AnonymousBlockBox) { ((AnonymousBlockBox) next).provideSiblingMarginToFloats( collapsedMargin.getMargin()); } if (! next.isSkipWhenCollapsingMargins()) { break; } else { next = (BlockBox) next.getNextSibling(); } } return next; }
openInlineBoxes = ((AnonymousBlockBox)box).getOpenInlineBoxes(); if (openInlineBoxes != null) { openInlineBoxes = new ArrayList(openInlineBoxes);
public void provideSiblingMarginToFloats(int margin) { for (Iterator i = getInlineContent().iterator(); i.hasNext(); ) { Styleable styleable = (Styleable)i.next(); if (styleable instanceof BlockBox) { BlockBox b = (BlockBox)styleable; if (b.isFloated()) { b.getFloatedBoxData().setMarginFromSibling(margin); } } } }
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) { Box result = super.find(cssCtx, absX, absY, findAnonymous); if (! findAnonymous && result == this) { return getParent(); } else { return result; } }
private BlockBox getNextCollapsableSibling(MarginCollapseResult collapsedMargin) { BlockBox next = (BlockBox) getNextSibling(); while (next != null) { if (next instanceof AnonymousBlockBox) { ((AnonymousBlockBox) next).provideSiblingMarginToFloats( collapsedMargin.getMargin()); } if (! next.isSkipWhenCollapsingMargins()) { break; } else { next = (BlockBox) next.getNextSibling(); } } return next; }
openInlineBoxes = ((AnonymousBlockBox)box).getOpenInlineBoxes(); if (openInlineBoxes != null) { openInlineBoxes = new ArrayList(openInlineBoxes);
private static void createAnonymousBlock(SharedContext c, Box parent, List inline, List savedParents) { WhitespaceStripper.stripInlineContent(inline); if (inline.size() > 0) { AnonymousBlockBox anon = new AnonymousBlockBox(parent.getElement()); anon.setStyle(parent.getStyle().createAnonymousStyle(IdentValue.BLOCK)); anon.setAnonymous(true); if (savedParents != null && savedParents.size() > 0) { anon.setOpenInlineBoxes(savedParents); } parent.addChild(anon); anon.setChildrenContentType(BlockBox.CONTENT_INLINE); anon.setInlineContent(inline); } }
public void layout(LayoutContext c) { layoutInlineChildren(c, 0, calcInitialBreakAtLine(c), true); }
public boolean isSkipWhenCollapsingMargins() { // An anonymous block will already have its children provided to it for (Iterator i = getInlineContent().iterator(); i.hasNext(); ) { Styleable styleable = (Styleable)i.next(); CalculatedStyle style = styleable.getStyle(); if (! (style.isFloated() || style.isAbsolute() || style.isFixed() || style.isRunning())) { return false; } } return true; }
public int getContentWidth() { return getContainingBlock().getContentWidth(); }
public boolean isSkipWhenCollapsingMargins() { // An anonymous block will already have its children provided to it for (Iterator i = getInlineContent().iterator(); i.hasNext(); ) { Styleable styleable = (Styleable)i.next(); CalculatedStyle style = styleable.getStyle(); if (! (style.isFloated() || style.isAbsolute() || style.isFixed() || style.isRunning())) { return false; } } return true; }