Example usage for org.w3c.dom.css CSSStyleDeclaration getPropertyPriority

List of usage examples for org.w3c.dom.css CSSStyleDeclaration getPropertyPriority

Introduction

In this page you can find the example usage for org.w3c.dom.css CSSStyleDeclaration getPropertyPriority.

Prototype

public String getPropertyPriority(String propertyName);

Source Link

Document

Used to retrieve the priority of a CSS property (e.g.

Usage

From source file:com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration.java

/**
 * Makes a local, "computed", modification to this CSS style.
 *
 * @param declaration the style declaration
 * @param selector the selector determining that the style applies to this element
 *//* w ww.  j a  v  a 2s  .  c  o  m*/
public void applyStyleFromSelector(final org.w3c.dom.css.CSSStyleDeclaration declaration,
        final Selector selector) {
    final SelectorSpecificity specificity = new SelectorSpecificity(selector);
    for (int k = 0; k < declaration.getLength(); k++) {
        final String name = declaration.item(k);
        final String value = declaration.getPropertyValue(name);
        final String priority = declaration.getPropertyPriority(name);
        applyLocalStyleAttribute(name, value, priority, specificity);
    }
}