Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSStyleDeclaration


  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserProperty(decl.item(j), decl, rd);
    }
      }
  }
    }
View Full Code Here


        (Element e, String pe, CSSOMReadOnlyStyleDeclaration rd) {
  if ((pe == null || pe.equals("")) &&
      e instanceof ElementNonCSSPresentationalHints) {
      ElementNonCSSPresentationalHints elt;
      elt = (ElementNonCSSPresentationalHints)e;
      CSSStyleDeclaration nonCSSDecl;
            nonCSSDecl = elt.getNonCSSPresentationalHints();
      if (nonCSSDecl != null) {
    int len = nonCSSDecl.getLength();
    for (int i = 0; i < len; i++) {
        setAuthorProperty(nonCSSDecl.item(i), nonCSSDecl, rd);
    }
      }
  }
    }
View Full Code Here

                                 authorRules);
            }
            authorRules = sortRules(authorRules, e, pe);
            for (int i = 0; i < authorRules.getLength(); i++) {
                CSSStyleRule rule = (CSSStyleRule)authorRules.item(i);
                CSSStyleDeclaration decl = rule.getStyle();
                int len = decl.getLength();
                for (int j = 0; j < len; j++) {
                    setAuthorProperty(decl.item(j), decl, rd);
                }
            }
  } catch (DOMException ex) {
            throw CSSDOMExceptionFactory.createDOMException
                (ex.code, "style.sheet",
View Full Code Here

                if (pe == null || pe.equals("") ||
                    e instanceof ExtendedElementCSSInlineStyle) {
                    hasStyle = ((ExtendedElementCSSInlineStyle)e).hasStyle();
                }
                if (hasStyle) {
                    CSSStyleDeclaration inlineDecl;
                    inlineDecl = ((ElementCSSInlineStyle)e).getStyle();
                    int len = inlineDecl.getLength();
                    for (int i = 0; i < len; i++) {
                        setAuthorProperty(inlineDecl.item(i), inlineDecl, rd);
                    }
                }
            }
  } catch (DOMException ex) {
            throw CSSDOMExceptionFactory.createDOMException
View Full Code Here

     * @param pe The pseudo-element to match.
     * @param rd The result style declaration.
     */
    protected void addOverrideStyleProperties
        (Element e, String pe, CSSOMReadOnlyStyleDeclaration rd) {
  CSSStyleDeclaration overrideDecl;
  overrideDecl = ((DocumentCSS)document).getOverrideStyle(e, pe);
  if ((pe == null || pe.equals("")) &&
      overrideDecl != null) {
      int len = overrideDecl.getLength();
      for (int i = 0; i < len; i++) {
    setAuthorProperty(overrideDecl.item(i), overrideDecl, rd);
      }
  }
    }
View Full Code Here

                                                     SVGDocument imgDocument) {

        // viewport is automatically created by the svg element of the image
        SVGSVGElement svgElement = imgDocument.getRootElement();
        CompositeGraphicsNode result = new CompositeGraphicsNode();
        CSSStyleDeclaration decl = CSSUtilities.getComputedStyle(element);
        UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, element);

        Rectangle2D r
            = CSSUtilities.convertEnableBackground(element, uctx);
        if (r != null) {
View Full Code Here

     * @param ctx the bridge context
     */
    protected static ICCColorSpaceExt extractColorSpace(Element element,
                                                        BridgeContext ctx) {

        CSSStyleDeclaration decl = CSSUtilities.getComputedStyle(element);
        String colorProfileProperty
            = ((CSSPrimitiveValue)decl.getPropertyCSSValue
               (CSS_COLOR_PROFILE_PROPERTY)).getStringValue();

        // The only cases that need special handling are 'sRGB' and 'name'
        ICCColorSpaceExt colorSpace = null;
        if (CSS_SRGB_VALUE.equalsIgnoreCase(colorProfileProperty)) {
View Full Code Here

     * Returns the translation of the non-CSS hints to the corresponding
     * CSS rules. The result can be null.
     */
    public static CSSStyleDeclaration getNonCSSPresentationalHints
        (Element elt) {
  CSSStyleDeclaration result = null;

  NamedNodeMap nnm = elt.getAttributes();
  int len = nnm.getLength();
  for (int i = 0; i < len; i++) {
      Node attr = nnm.item(i);
      String an = attr.getNodeName();
      if (PRESENTATION_ATTRIBUTES.contains(an)) {
    if (result == null) {
        DOMImplementation impl;
                    impl = elt.getOwnerDocument().getImplementation();
        CSSStyleDeclarationFactory f;
                    f = (CSSStyleDeclarationFactory)impl;
        result = f.createCSSStyleDeclaration();
    }
    result.setProperty(an, attr.getNodeValue(), "");
      }
  }
  return result;
    }
View Full Code Here

                    source = (Filter)filterMap.get(SVG_SOURCE_GRAPHIC_VALUE);
                    source = new FilterAlphaRable(source);
                }
            } else if (SVG_STROKE_PAINT_VALUE.equals(s)) {
                    // StrokePaint
                    CSSStyleDeclaration cssDecl
                        = CSSUtilities.getComputedStyle(filteredElement);
                    Paint paint = PaintServer.convertStrokePaint
                        (filteredElement,filteredNode, ctx);
                    // <!> FIXME: Should we create a transparent flood ???
                    source = new FloodRable8Bit(INFINITE_FILTER_REGION, paint);
            }
            break;
        case 15:
            if (s.charAt(10) == SVG_BACKGROUND_IMAGE_VALUE.charAt(10)) {
                if (SVG_BACKGROUND_IMAGE_VALUE.equals(s)) {
                    // BackgroundImage
                    source = new BackgroundRable8Bit
                        (filteredNode, ctx.getGraphicsNodeRenderContext());
                }
            } else if (SVG_BACKGROUND_ALPHA_VALUE.equals(s)) {
                // BackgroundAlpha
                source = new BackgroundRable8Bit
                    (filteredNode, ctx.getGraphicsNodeRenderContext());
                source = new FilterAlphaRable(source);
            }
            break;
        case 9:
            if (SVG_FILL_PAINT_VALUE.equals(s)) {
                // FillPaint
                CSSStyleDeclaration cssDecl
                    = CSSUtilities.getComputedStyle(filteredElement);
                Paint paint = PaintServer.convertFillPaint
                    (filteredElement,filteredNode, ctx);
                if (paint == null) {
                    paint = new Color(0, 0, 0, 0); // create a transparent flood
View Full Code Here

    /**
     * To implement {@link org.w3c.dom.svg.SVGStylable#getStyle()}.
     */
    public CSSStyleDeclaration getStyle(Element elt) {
        CSSStyleDeclaration style;
        if (inlineStyle == null ||
            (style = (CSSStyleDeclaration)inlineStyle.get()) == null) {
      SVGDOMImplementation impl;
            impl = (SVGDOMImplementation)elt.getOwnerDocument().
                getImplementation();
      style = impl.createCSSStyleDeclaration();
      style.setCssText(elt.getAttribute(STYLE));
            inlineStyle = new WeakReference(style);
        }
        return style;
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.css.CSSStyleDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.