public boolean isCleared() { return ! isIdent(CSSName.CLEAR, IdentValue.NONE); }
public boolean establishesBFC() { FSDerivedValue value = valueByName(CSSName.POSITION); if (value instanceof FunctionValue) { // running(header) return false; } else { IdentValue display = getIdent(CSSName.DISPLAY); IdentValue position = (IdentValue)value; return isFloated() || position == IdentValue.ABSOLUTE || position == IdentValue.FIXED || display == IdentValue.INLINE_BLOCK || display == IdentValue.TABLE_CELL || ! isIdent(CSSName.OVERFLOW, IdentValue.VISIBLE); } }
private FSImage getBackgroundImage(RenderingContext c, CalculatedStyle style) { if (! style.isIdent(CSSName.BACKGROUND_IMAGE, IdentValue.NONE)) { String uri = style.getStringProperty(CSSName.BACKGROUND_IMAGE); try { return c.getUac().getImageResource(uri).getImage(); } catch (Exception ex) { ex.printStackTrace(); Uu.p(ex); } } return null; }
private FSImage getBackgroundImage(RenderingContext c, CalculatedStyle style) { if (! style.isIdent(CSSName.BACKGROUND_IMAGE, IdentValue.NONE)) { String uri = style.getStringProperty(CSSName.BACKGROUND_IMAGE); try { return c.getUac().getImageResource(uri).getImage(); } catch (Exception ex) { ex.printStackTrace(); Uu.p(ex); } } return null; }
public boolean isNeedsClipOnPaint(RenderingContext c) { return ! isReplaced() && getStyle().isIdent(CSSName.OVERFLOW, IdentValue.HIDDEN) && getStyle().isOverflowApplies(); }
private static void addColumnOrColumnGroup( LayoutContext c, TableBox table, Element e, CalculatedStyle style) { if (style.isIdent(CSSName.DISPLAY, IdentValue.TABLE_COLUMN)) { table.addStyleColumn(new TableColumn(e, style)); } else { /* style.isIdent(CSSName.DISPLAY, IdentValue.TABLE_COLUMN_GROUP) */ addColumns(c, table, new TableColumn(e, style)); } }
private static void addColumnOrColumnGroup( LayoutContext c, TableBox table, Element e, CalculatedStyle style) { if (style.isIdent(CSSName.DISPLAY, IdentValue.TABLE_COLUMN)) { table.addStyleColumn(new TableColumn(e, style)); } else { /* style.isIdent(CSSName.DISPLAY, IdentValue.TABLE_COLUMN_GROUP) */ addColumns(c, table, new TableColumn(e, style)); } }
private int calcPinnedHeight(CssContext c) { if (! getStyle().isIdent(CSSName.TOP, IdentValue.AUTO) && ! getStyle().isIdent(CSSName.BOTTOM, IdentValue.AUTO)) { Rectangle paddingEdge = getContainingBlock().getPaddingEdge(0, 0, c); int top = (int) getStyle().getFloatPropertyProportionalTo( CSSName.TOP, paddingEdge.height, c); int bottom = (int) getStyle().getFloatPropertyProportionalTo( CSSName.BOTTOM, paddingEdge.height, c); int result = paddingEdge.height - top - bottom; return result < 0 ? 0 : result; } return -1; }
public boolean isNeedsClipOnPaint(RenderingContext c) { return ! isReplaced() && getStyle().isIdent(CSSName.OVERFLOW, IdentValue.HIDDEN) && getStyle().isOverflowApplies(); }
public boolean isInline() { return isIdent(CSSName.DISPLAY, IdentValue.INLINE) && ! (isFloated() || isAbsolute() || isFixed() || isRunning()); }
private int calcPinnedHeight(CssContext c) { if (! getStyle().isIdent(CSSName.TOP, IdentValue.AUTO) && ! getStyle().isIdent(CSSName.BOTTOM, IdentValue.AUTO)) { int top = (int) getStyle().getFloatPropertyProportionalTo( CSSName.TOP, getContainingBlockWidth(), c); int bottom = (int) getStyle().getFloatPropertyProportionalTo( CSSName.BOTTOM, getContainingBlockWidth(), c); int result = getContainingBlock().getPaddingEdge(0, 0, c).height - top - bottom; return result < 0 ? 0 : result; } return -1; }
private int calcPinnedContentWidth(CssContext c) { if (! getStyle().isIdent(CSSName.LEFT, IdentValue.AUTO) && ! getStyle().isIdent(CSSName.RIGHT, IdentValue.AUTO)) { Rectangle paddingEdge = getContainingBlock().getPaddingEdge(0, 0, c); int left = (int) getStyle().getFloatPropertyProportionalTo( CSSName.LEFT, paddingEdge.width, c); int right = (int) getStyle().getFloatPropertyProportionalTo( CSSName.RIGHT, paddingEdge.width, c); int result = paddingEdge.width - left - right - getLeftMBP() - getRightMBP(); return result < 0 ? 0 : result; } return -1; }
public void setStyle(CalculatedStyle style) { super.setStyle(style); if (isMarginAreaRoot()) { _tableLayout = new MarginTableLayout(this); } else if (getStyle().isIdent(CSSName.TABLE_LAYOUT, IdentValue.FIXED)) { _tableLayout = new FixedTableLayout(this); } else { _tableLayout = new AutoTableLayout(this); } }
private int calcPinnedContentWidth(CssContext c) { if (! getStyle().isIdent(CSSName.LEFT, IdentValue.AUTO) && ! getStyle().isIdent(CSSName.RIGHT, IdentValue.AUTO)) { int left = (int) getStyle().getFloatPropertyProportionalTo( CSSName.LEFT, getContainingBlockWidth(), c); int right = (int) getStyle().getFloatPropertyProportionalTo( CSSName.RIGHT, getContainingBlockWidth(), c); int result = getContainingBlock().getPaddingWidth(c) - left - right - getLeftMBP() - getRightMBP(); return result < 0 ? 0 : result; } return -1; }
public void setStyle(CalculatedStyle style) { super.setStyle(style); if (isMarginAreaRoot()) { _tableLayout = new MarginTableLayout(this); } else if (getStyle().isIdent(CSSName.TABLE_LAYOUT, IdentValue.AUTO) || getStyle().isAutoWidth()) { _tableLayout = new AutoTableLayout(this); } else { _tableLayout = new FixedTableLayout(this); } }
private void calcWidth() { if (getMinWidth() > getWidth()) { setContentWidth(getContentWidth() + getMinWidth() - getWidth()); } else if (getStyle().isIdent(CSSName.WIDTH, IdentValue.AUTO) && getMaxWidth() < getWidth()) { setContentWidth(getContentWidth() - (getWidth() - getMaxWidth())); } }
private void calcWidth() { if (getMinWidth() > getWidth()) { setContentWidth(getContentWidth() + getMinWidth() - getWidth()); } else if (getStyle().isIdent(CSSName.WIDTH, IdentValue.AUTO) && getMaxWidth() < getWidth()) { setContentWidth(getContentWidth() - (getWidth() - getMaxWidth())); } }