Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSStyleDeclaration


    /**
     * 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;

        SVGDOMImplementation svgImpl;
        svgImpl = (SVGDOMImplementation)elt.getOwnerDocument().getImplementation();
        Set pa = svgImpl.getPresentionAttributeSet();
  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 (pa.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


    public CSSStyleDeclaration getOverrideStyle(String pseudoElt) {
  if (overrideStyles == null) {
      overrideStyles = new HashTable();
  }
  pseudoElt = (pseudoElt == null) ? "" : pseudoElt;
  CSSStyleDeclaration result;
        result = (CSSStyleDeclaration)overrideStyles.get(pseudoElt);
  if (result == null) {
      result = factory.createCSSStyleDeclaration();
      overrideStyles.put(pseudoElt, result);
  }
View Full Code Here

    /**
     * Updates a property value in this target.
     */
    public void updatePropertyValue(String pn, AnimatableValue val) {
        CSSStyleDeclaration over = getOverrideStyle();
        if (val == null) {
            over.removeProperty(pn);
        } else {
            over.setProperty(pn, val.getCssText(), "");
        }
    }
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link org.w3c.flex.forks.dom.svg.SVGStylable#getStyle()}.
     */
    public CSSStyleDeclaration getStyle() {
        CSSStyleDeclaration result =
            (CSSStyleDeclaration)getLiveAttributeValue(null,
                                                       SVG_STYLE_ATTRIBUTE);
        if (result == null) {
            CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
            result = new StyleDeclaration(eng);
View Full Code Here

                throw new BridgeException
                    (ctx, animElt, "attribute.not.animatable",
                     new Object[] { target.getElement().getNodeName(), pn });
            }
            SVGStylableElement e = (SVGStylableElement) target.getElement();
            CSSStyleDeclaration over = e.getOverrideStyle();
            String oldValue = over.getPropertyValue(pn);
            if (oldValue != null) {
                over.removeProperty(pn);
            }
            Value v = cssEngine.getComputedStyle(e, null, idx);
            if (oldValue != null && !oldValue.equals("")) {
                over.setProperty(pn, oldValue, null);
            }
            return factories[type].createValue(target, pn, v);
        }
        // XXX Doesn't handle shorthands.
        return null;
View Full Code Here

        if (ve == null) {
            return "";
        }
        if (ve.value == null) { // ||
            //ve.value.getImmutableValue() == ImmutableInherit.INSTANCE) {
            CSSStyleDeclaration sd;
            sd = viewCSS.getComputedStyle(parentElement, null);
            return sd.getPropertyCSSValue(s).getCssText();
        } else {
            return ve.value.getCssText();
        }
    }
View Full Code Here

  ValueEntry ve = properties.get(s);
        if (ve == null) {
            return null;
        }
        if (ve.value == null) {
            CSSStyleDeclaration sd;
            sd = viewCSS.getComputedStyle(parentElement, null);
            CSSOMReadOnlyValue v =
                (CSSOMReadOnlyValue)sd.getPropertyCSSValue(s);
            return ve.value = new CSSOMReadOnlyValue(v.getImmutableValue());
        } else {
            return ve.value;
        }
    }
View Full Code Here

        if (ve == null) {
            return AUTHOR_ORIGIN;
        }
        if (ve.value == null) { // ||
            //ve.value.getImmutableValue() == ImmutableInherit.INSTANCE) {
            CSSStyleDeclaration sd;
            sd = viewCSS.getComputedStyle(parentElement, null);
            return ((CSSOMReadOnlyStyleDeclaration)
                    sd).getPropertyOrigin(s);
        } else {
            return ve.getOrigin();
View Full Code Here

        if (ve == null) {
            return "";
        }
        if (ve.value == null) { // ||
            //ve.value.getImmutableValue() == ImmutableInherit.INSTANCE) {
            CSSStyleDeclaration sd;
            sd = viewCSS.getComputedStyle(parentElement, null);
            return ((CSSOMReadOnlyStyleDeclaration)
                    sd).getPropertyPriority(s);
        } else {
            return ve.getPriority();
View Full Code Here

      addMatchingRules(userAgentStyleSheet.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++) {
        setUserAgentProperty(decl.item(j), decl, rd);
    }
      }
  }
    }
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.