/** * Returns a Map keyed by CSS property names (e.g. 'border-width'), and the * assigned value as a SAC CSSValue instance. The properties should have * been matched to the element when the Context was established for this * StyleReference on the Document to which the Element belongs. See {@link * org.xhtmlrenderer.swing.BasicPanel#setDocument(Document, java.net.URL)} * for an example of how to establish a StyleReference and associate to a * Document. * * @param e The DOM Element for which to find properties * @return Map of CSS property names to CSSValue instance assigned to it. */ public java.util.Map getCascadedPropertiesMap(Element e) { CascadedStyle cs = _matcher.getCascadedStyle(e, false);//this is only for debug, I think java.util.LinkedHashMap props = new java.util.LinkedHashMap(); for (java.util.Iterator i = cs.getCascadedPropertyDeclarations(); i.hasNext();) { PropertyDeclaration pd = (PropertyDeclaration) i.next(); String propName = pd.getPropertyName(); CSSName cssName = CSSName.getByPropertyName(propName); props.put(propName, cs.propertyByName(cssName).getValue()); } return props; }
/** * Returns a Map keyed by CSS property names (e.g. 'border-width'), and the * assigned value as a SAC CSSValue instance. The properties should have * been matched to the element when the Context was established for this * StyleReference on the Document to which the Element belongs. See {@link * org.xhtmlrenderer.swing.BasicPanel#setDocument(Document, java.net.URL)} * for an example of how to establish a StyleReference and associate to a * Document. * * @param e The DOM Element for which to find properties * @return Map of CSS property names to CSSValue instance assigned to it. */ public java.util.Map getCascadedPropertiesMap(Element e) { CascadedStyle cs = _matcher.getCascadedStyle(e, false);//this is only for debug, I think java.util.LinkedHashMap props = new java.util.LinkedHashMap(); for (java.util.Iterator i = cs.getCascadedPropertyDeclarations(); i.hasNext();) { PropertyDeclaration pd = (PropertyDeclaration) i.next(); String propName = pd.getPropertyName(); CSSName cssName = CSSName.getByPropertyName(propName); props.put(propName, cs.propertyByName(cssName).getValue()); } return props; }
if (fallback.startsWith("=")) fallback = CSSName.initialValue(CSSName.getByPropertyName(fallback.substring(1))); val = getColorHex(fallback);
if (fallback.startsWith("=")) fallback = CSSName.initialValue(CSSName.getByPropertyName(fallback.substring(1))); val = getColorHex(fallback);
CSSName ref = CSSName.getByPropertyName(initialValue.substring(1)); val = valueByName(ref); } else {
CSSName ref = CSSName.getByPropertyName(initialValue.substring(1)); val = valueByName(ref); } else {
if (t == Token.TK_IDENT) { String propertyName = property(); CSSName cssName = CSSName.getByPropertyName(propertyName);
if (t == Token.TK_IDENT) { String propertyName = property(); CSSName cssName = CSSName.getByPropertyName(propertyName);