/** * Returns the value at the given. */ public String item(int idx) { return cssEngine.getPropertyName(declaration.getIndex(idx)); } }
/** * Returns the value at the given. */ public String item(int idx) { return cssEngine.getPropertyName(declaration.getIndex(idx)); } }
/** * Returns the value at the given. */ public String item(int idx) { return cssEngine.getPropertyName(declaration.getIndex(idx)); } }
/** * Returns the current value associated with this object. */ public Value getValue(String name) { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { return declaration.getValue(i); } } return null; }
/** * Tells whether the given property is important. */ public boolean isImportant(String name) { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { return declaration.getPriority(i); } } return false; }
/** * Tells whether the given property is important. */ public boolean isImportant(String name) { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { return declaration.getPriority(i); } } return false; }
/** * Returns the current value associated with this object. */ public Value getValue(String name) { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { return declaration.getValue(i); } } return null; }
/** * Returns the current value associated with this object. */ public Value getValue(String name) { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { return declaration.getValue(i); } } return null; }
/** * Tells whether the given property is important. */ public boolean isImportant(String name) { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { return declaration.getPriority(i); } } return false; }
/** * Called when a property was removed. */ public void propertyRemoved(String name) throws DOMException { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { declaration.remove(i); mutate = true; setAttributeNS(null, SVG_STYLE_ATTRIBUTE, declaration.toString(cssEngine)); mutate = false; return; } } }
/** * Called when a property was removed. */ public void propertyRemoved(String name) throws DOMException { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { declaration.remove(i); mutate = true; setAttributeNS(null, SVG_STYLE_ATTRIBUTE, declaration.toString(cssEngine)); mutate = false; return; } } }
/** * Called when a property was removed. */ public void propertyRemoved(String name) throws DOMException { int idx = cssEngine.getPropertyIndex(name); for (int i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { declaration.remove(i); mutate = true; setAttributeNS(null, SVG_STYLE_ATTRIBUTE, declaration.toString(cssEngine)); mutate = false; return; } } }
/** * Sets a main property value in response to a shorthand property * being set. */ public void setMainProperty(String name, Value v, boolean important) { int idx = cssEngine.getPropertyIndex(name); if (idx == -1) return; // unknown property int i; for (i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) break; } if (i < declaration.size()) declaration.put(i, v, idx, important); else declaration.append(v, idx, important); } }
/** * Sets a main property value in response to a shorthand property * being set. */ public void setMainProperty(String name, Value v, boolean important) { int idx = cssEngine.getPropertyIndex(name); if (idx == -1) return; // unknown property int i; for (i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) break; } if (i < declaration.size()) declaration.put(i, v, idx, important); else declaration.append(v, idx, important); } }
/** * Sets a main property value in response to a shorthand property * being set. */ public void setMainProperty(String name, Value v, boolean important) { int idx = cssEngine.getPropertyIndex(name); if (idx == -1) return; // unknown property int i; for (i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) break; } if (i < declaration.size()) declaration.put(i, v, idx, important); else declaration.append(v, idx, important); } }
/** * Sets a main property value in response to a shorthand property * being set. */ public void setMainProperty(String name, Value v, boolean important) { int idx = getPropertyIndex(name); if (idx == -1) { return; // unknown property } int i; for (i = 0; i < declaration.size(); i++) { if (idx == declaration.getIndex(i)) { break; } } if (i < declaration.size()) { declaration.put(i, v, idx, important); } else { declaration.append(v, idx, important); } } }
/** * A property in the override style declaration has been removed. */ public void overrideStylePropertyRemoved(CSSStylableElement elt, String name) { StyleDeclarationProvider p = elt.getOverrideStyleDeclarationProvider(); StyleDeclaration declaration = p.getStyleDeclaration(); int idx = getPropertyIndex(name); int ds = declaration.size(); for (int i = 0; i < ds; i++) { if (idx == declaration.getIndex(i)) { declaration.remove(i); StyleMap style = elt.getComputedStyleMap(null); if (style != null && style.getOrigin(idx) == StyleMap.OVERRIDE_ORIGIN /* && style.isComputed(idx) */) { invalidateProperties (elt, new int[] { idx }, null, true); } break; } } }
/** * A property in the override style declaration has been removed. */ public void overrideStylePropertyRemoved(CSSStylableElement elt, String name) { StyleDeclarationProvider p = elt.getOverrideStyleDeclarationProvider(); StyleDeclaration declaration = p.getStyleDeclaration(); int idx = getPropertyIndex(name); int ds = declaration.size(); for (int i = 0; i < ds; i++) { if (idx == declaration.getIndex(i)) { declaration.remove(i); StyleMap style = elt.getComputedStyleMap(null); if (style != null && style.getOrigin(idx) == StyleMap.OVERRIDE_ORIGIN /* && style.isComputed(idx) */) { invalidateProperties (elt, new int[] { idx }, null, true); } break; } } }
/** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.DocumentHandler#endFontFace()}. */ public void endFontFace() throws CSSException { StyleMap sm = new StyleMap(getNumberOfProperties()); int len = styleDeclaration.size(); for (int i=0; i<len; i++) { int idx = styleDeclaration.getIndex(i); sm.putValue(idx, styleDeclaration.getValue(i)); sm.putImportant(idx, styleDeclaration.getPriority(i)); // Not sure on this.. sm.putOrigin(idx, StyleMap.AUTHOR_ORIGIN); } styleDeclaration = null; int pidx = getPropertyIndex(CSSConstants.CSS_FONT_FAMILY_PROPERTY); Value fontFamily = sm.getValue(pidx); if (fontFamily == null) return; ParsedURL base = getCSSBaseURI(); fontFaces.add(new FontFaceRule(sm, base)); }
/** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.DocumentHandler#endFontFace()}. */ public void endFontFace() throws CSSException { StyleMap sm = new StyleMap(getNumberOfProperties()); int len = styleDeclaration.size(); for (int i=0; i<len; i++) { int idx = styleDeclaration.getIndex(i); sm.putValue(idx, styleDeclaration.getValue(i)); sm.putImportant(idx, styleDeclaration.getPriority(i)); // Not sure on this.. sm.putOrigin(idx, StyleMap.AUTHOR_ORIGIN); } styleDeclaration = null; int pidx = getPropertyIndex(CSSConstants.CSS_FONT_FAMILY_PROPERTY); Value fontFamily = sm.getValue(pidx); if (fontFamily == null) return; ParsedURL base = getCSSBaseURI(); fontFaces.add(new FontFaceRule(sm, base)); }