public boolean isColorTransparentForElement(Element element, int styleIndex) { Value v = getCssValue(element, styleIndex); // XXX #94265 The initial is transparent, but that doesn't work (in browser it doesn't seem to be transparent), // or there might be browser specific stylesheets changing the default behavior. // Hack: For now we ignore when it is initial value. // if (v == CssValueConstants.TRANSPARENT_RGB_VALUE) { // return true; // } if (v instanceof ComputedValue) { return ((ComputedValue)v).getComputedValue() == CssValueConstants.TRANSPARENT_RGB_VALUE; } return false; }
public Color getColorForElement(Element element, int styleIndex) { Value v = getCssValue(element, styleIndex); if (v == CssValueConstants.TRANSPARENT_RGB_VALUE) { return null; } if (v instanceof ComputedValue && ((ComputedValue)v).getComputedValue() == CssValueConstants.TRANSPARENT_RGB_VALUE) { return null; } if (v != null) { //if (v.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { return convertColor(v /*, 1*/); /* } else { return PaintServer.convertRGBICCColor (e, v.item(0), (ICCColor)v.item(1), 1, ctx); } */ } return null; }
public CssListValue getComputedCssListValue(CssValue cssValue) { if (cssValue == null) { return null; } Value value = ((CssValueImpl)cssValue).getValue(); if (value instanceof ListValue) { return CssValueFactory.createCssListValue((ListValue)value); } else if (value instanceof ComputedValue) { ComputedValue computedValue = (ComputedValue)value; Value result = computedValue.getComputedValue(); if (result instanceof ListValue) { return CssValueFactory.createCssListValue((ListValue)result); } } return null; }
protected float getLineHeight(BridgeContext ctx, Element element, float fontSize) { if (lineHeightIndex == -1) initCSSPropertyIndexes(element); Value v = CSSUtilities.getComputedStyle(element, lineHeightIndex); if ((v == ValueConstants.INHERIT_VALUE) || (v == SVG12ValueConstants.NORMAL_VALUE)) { return fontSize*1.1f; } float lineHeight = v.getFloatValue(); if (v instanceof ComputedValue) v = ((ComputedValue)v).getComputedValue(); if ((v instanceof LineHeightValue) && ((LineHeightValue)v).getFontSizeRelative()) lineHeight *= fontSize; return lineHeight; }
protected float getLineHeight(BridgeContext ctx, Element element, float fontSize) { if (lineHeightIndex == -1) initCSSPropertyIndexes(element); Value v = CSSUtilities.getComputedStyle(element, lineHeightIndex); if ((v == ValueConstants.INHERIT_VALUE) || (v == SVG12ValueConstants.NORMAL_VALUE)) { return fontSize*1.1f; } float lineHeight = v.getFloatValue(); if (v instanceof ComputedValue) v = ((ComputedValue)v).getComputedValue(); if ((v instanceof LineHeightValue) && ((LineHeightValue)v).getFontSizeRelative()) lineHeight *= fontSize; return lineHeight; }
protected float getLineHeight(BridgeContext ctx, Element element, float fontSize) { if (lineHeightIndex == -1) initCSSPropertyIndexes(element); Value v = CSSUtilities.getComputedStyle(element, lineHeightIndex); if ((v == ValueConstants.INHERIT_VALUE) || (v == SVG12ValueConstants.NORMAL_VALUE)) { return fontSize*1.1f; } float lineHeight = v.getFloatValue(); if (v instanceof ComputedValue) v = ((ComputedValue)v).getComputedValue(); if ((v instanceof LineHeightValue) && ((LineHeightValue)v).getFontSizeRelative()) lineHeight *= fontSize; return lineHeight; }