public CalculatedStyle deriveAll(CalculatedStyle start) { CalculatedStyle result = start; for (Iterator i = getStyles().iterator(); i.hasNext(); ) { result = result.deriveStyle((CascadedStyle)i.next()); } return result; }
public CalculatedStyle deriveAll(CalculatedStyle start) { CalculatedStyle result = start; for (Iterator i = getStyles().iterator(); i.hasNext(); ) { result = result.deriveStyle((CascadedStyle)i.next()); } return result; }
public CalculatedStyle createAnonymousStyle(IdentValue display) { return deriveStyle(CascadedStyle.createAnonymousStyle(display)); }
public CalculatedStyle createAnonymousStyle(IdentValue display) { return deriveStyle(CascadedStyle.createAnonymousStyle(display)); }
public CalculatedStyle getStyle(Element e, boolean restyle) { if (styleMap == null) { styleMap = new HashMap(1024, 0.75f); } CalculatedStyle result = null; if (! restyle) { result = (CalculatedStyle)styleMap.get(e); } if (result == null) { Node parent = e.getParentNode(); CalculatedStyle parentCalculatedStyle; if (parent instanceof Document) { parentCalculatedStyle = new EmptyStyle(); } else { parentCalculatedStyle = getStyle((Element)parent, false); } result = parentCalculatedStyle.deriveStyle(getCss().getCascadedStyle(e, restyle)); styleMap.put(e, result); } return result; }
public CalculatedStyle getStyle(Element e, boolean restyle) { if (styleMap == null) { styleMap = new HashMap(1024, 0.75f); } CalculatedStyle result = null; if (! restyle) { result = (CalculatedStyle)styleMap.get(e); } if (result == null) { Node parent = e.getParentNode(); CalculatedStyle parentCalculatedStyle; if (parent instanceof Document) { parentCalculatedStyle = new EmptyStyle(); } else { parentCalculatedStyle = getStyle((Element)parent, false); } result = parentCalculatedStyle.deriveStyle(getCss().getCascadedStyle(e, restyle)); styleMap.put(e, result); } return result; }
iB.getElement(), iB.getPseudoElementOrClass()); styles.add(((CalculatedStyle) styles.getLast()).deriveStyle(cs)); } else { styles.add(style.createAnonymousStyle(IdentValue.INLINE));
iB.getElement(), iB.getPseudoElementOrClass()); styles.add(((CalculatedStyle) styles.getLast()).deriveStyle(cs)); } else { styles.add(style.createAnonymousStyle(IdentValue.INLINE));
private static void insertGeneratedContent( LayoutContext c, Element element, CalculatedStyle parentStyle, String peName, List children, ChildBoxInfo info) { CascadedStyle peStyle = c.getCss().getPseudoElementStyle(element, peName); if (peStyle != null) { PropertyDeclaration contentDecl = (PropertyDeclaration) peStyle.propertyByName(CSSName.CONTENT); PropertyDeclaration counterResetDecl = (PropertyDeclaration) peStyle.propertyByName(CSSName.COUNTER_RESET); PropertyDeclaration counterIncrDecl = (PropertyDeclaration) peStyle.propertyByName(CSSName.COUNTER_INCREMENT); CalculatedStyle calculatedStyle = null; if (contentDecl != null || counterResetDecl != null || counterIncrDecl != null) { calculatedStyle = parentStyle.deriveStyle(peStyle); if (calculatedStyle.isDisplayNone()) return; if (calculatedStyle.isIdent(CSSName.CONTENT, IdentValue.NONE)) return; if (calculatedStyle.isIdent(CSSName.CONTENT, IdentValue.NORMAL) && (peName.equals("before") || peName.equals("after"))) return; c.resolveCounters(calculatedStyle); } if (contentDecl != null) { CSSPrimitiveValue propValue = contentDecl.getValue(); children.addAll(createGeneratedContent(c, element, peName, calculatedStyle, (PropertyValue) propValue, info)); } } }
private static void insertGeneratedContent( LayoutContext c, Element element, CalculatedStyle parentStyle, String peName, List children, ChildBoxInfo info) { CascadedStyle peStyle = c.getCss().getPseudoElementStyle(element, peName); if (peStyle != null) { PropertyDeclaration contentDecl = peStyle.propertyByName(CSSName.CONTENT); PropertyDeclaration counterResetDecl = peStyle.propertyByName(CSSName.COUNTER_RESET); PropertyDeclaration counterIncrDecl = peStyle.propertyByName(CSSName.COUNTER_INCREMENT); CalculatedStyle calculatedStyle = null; if (contentDecl != null || counterResetDecl != null || counterIncrDecl != null) { calculatedStyle = parentStyle.deriveStyle(peStyle); if (calculatedStyle.isDisplayNone()) return; if (calculatedStyle.isIdent(CSSName.CONTENT, IdentValue.NONE)) return; if (calculatedStyle.isIdent(CSSName.CONTENT, IdentValue.NORMAL) && (peName.equals("before") || peName.equals("after"))) return; c.resolveCounters(calculatedStyle); } if (contentDecl != null) { CSSPrimitiveValue propValue = contentDecl.getValue(); children.addAll(createGeneratedContent(c, element, peName, calculatedStyle, (PropertyValue) propValue, info)); } } }
CSSName.FLOAT, table.getStyle().getIdent(CSSName.FLOAT))}); anonStyle = table.getStyle().deriveStyle(cascadedStyle); } else { anonStyle = table.getStyle().createAnonymousStyle(IdentValue.BLOCK); CSSName.FLOAT, IdentValue.NONE) }); table.setStyle(table.getStyle().getParent().deriveStyle(modified));
CSSName.FLOAT, table.getStyle().getIdent(CSSName.FLOAT))}); anonStyle = table.getStyle().deriveStyle(cascadedStyle); } else { anonStyle = table.getStyle().createAnonymousStyle(IdentValue.BLOCK); CSSName.FLOAT, IdentValue.NONE) }); table.setStyle(table.getStyle().getParent().deriveStyle(modified));
if (e != null) { style = c.getSharedContext().getStyle(e, true); style = style.deriveStyle(c.getCss().getPseudoElementStyle(e, pe)); } else { BlockBox container = (BlockBox)getParent().getParent(); e = container.getElement(); style = c.getSharedContext().getStyle(e, true); style = style.deriveStyle(c.getCss().getPseudoElementStyle(e, pe)); style = style.createAnonymousStyle(IdentValue.INLINE);
if (e != null) { style = c.getSharedContext().getStyle(e, true); style = style.deriveStyle(c.getCss().getPseudoElementStyle(e, pe)); } else { BlockBox container = (BlockBox)getParent().getParent(); e = container.getElement(); style = c.getSharedContext().getStyle(e, true); style = style.deriveStyle(c.getCss().getPseudoElementStyle(e, pe)); style = style.createAnonymousStyle(IdentValue.INLINE);
CalculatedStyle pageStyle = new EmptyStyle().deriveStyle(pageInfo.getPageStyle()); CalculatedStyle tableStyle = pageStyle.deriveStyle( CascadedStyle.createLayoutStyle(new PropertyDeclaration[] { new PropertyDeclaration(
CalculatedStyle pageStyle = new EmptyStyle().deriveStyle(pageInfo.getPageStyle()); CalculatedStyle tableStyle = pageStyle.deriveStyle( CascadedStyle.createLayoutStyle(new PropertyDeclaration[] { new PropertyDeclaration(