public String getAllStylesForElement(Element element) { if (!(element instanceof CSSStylableElement)) { return ""; } Document document = element.getOwnerDocument(); XhtmlCssEngine engine = getCssEngine(document); if (engine != null) { CSSStylableElement elt = (CSSStylableElement)element; StyleMap map = elt.getComputedStyleMap(null); if (map != null) { return map.toString(engine); } } return ""; // NOI18N }
public boolean isInlineStyleValue(Element element, int propidx) { if (!(element instanceof CSSStylableElement)) { return false; } CSSStylableElement elt = (CSSStylableElement)element; String pseudo = ""; // Pending // NOI18N StyleMap sm = elt.getComputedStyleMap(pseudo); if (sm == null) { return false; } Value value = sm.getValue(propidx); if (value == null) { return false; } return sm.getOrigin(propidx) == StyleMap.INLINE_AUTHOR_ORIGIN; } // </Non engine methods, might be separated>
StyleMap style = elt.getComputedStyleMap(null); if (style != null) { if (attrNS == styleNamespaceURI
StyleMap style = elt.getComputedStyleMap(null); if (style != null) { if (attrNS == styleNamespaceURI
public void uncomputeValueForElement(Element element, int propIndex) { if (!(element instanceof CSSStylableElement)) { return; } Document document = element.getOwnerDocument(); XhtmlCssEngine engine = getCssEngine(document); if (engine == null) { return; } // RaveElement xel = (RaveElement)e; CSSStylableElement elt = (CSSStylableElement)element; StyleMap sm = elt.getComputedStyleMap(null); if (sm != null) { Value v = sm.getValue(propIndex); if (v instanceof ComputedValue) { ComputedValue cv = (ComputedValue)v; sm.putComputed(propIndex, false); sm.putValue(propIndex, cv.getCascadedValue()); } } }
((CSSStylableElement)paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) {
((CSSStylableElement)paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) {
((CSSStylableElement)paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) {
((CSSStylableElement)paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) {
((CSSStylableElement)paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) {
((CSSStylableElement)paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) {
/** * 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; } } }
/** * 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; } } }
/** * Constructs a TextDecoration object for the specified element. This will * contain all of the decoration properties to be used when drawing the * text. */ protected TextPaintInfo getTextPaintInfo(Element element, GraphicsNode node, TextPaintInfo parentTPI, BridgeContext ctx) { // Force the engine to update stuff.. CSSUtilities.getComputedStyle (element, SVGCSSEngine.TEXT_DECORATION_INDEX); TextPaintInfo pi = new TextPaintInfo(parentTPI); // Was text-decoration explicity set on this element? StyleMap sm = ((CSSStylableElement)element).getComputedStyleMap(null); if ((sm.isNullCascaded(SVGCSSEngine.TEXT_DECORATION_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.FILL_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.STROKE_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.STROKE_WIDTH_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.OPACITY_INDEX))) { // If not, keep the same decorations. return pi; } setBaseTextPaintInfo(pi, element, node, ctx); if (!sm.isNullCascaded(SVGCSSEngine.TEXT_DECORATION_INDEX)) setDecorationTextPaintInfo(pi, element); return pi; }
/** * Constructs a TextDecoration object for the specified element. This will * contain all of the decoration properties to be used when drawing the * text. */ protected TextPaintInfo getTextPaintInfo(Element element, GraphicsNode node, TextPaintInfo parentTPI, BridgeContext ctx) { // Force the engine to update stuff.. CSSUtilities.getComputedStyle (element, SVGCSSEngine.TEXT_DECORATION_INDEX); TextPaintInfo pi = new TextPaintInfo(parentTPI); // Was text-decoration explicity set on this element? StyleMap sm = ((CSSStylableElement)element).getComputedStyleMap(null); if ((sm.isNullCascaded(SVGCSSEngine.TEXT_DECORATION_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.FILL_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.STROKE_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.STROKE_WIDTH_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.OPACITY_INDEX))) { // If not, keep the same decorations. return pi; } setBaseTextPaintInfo(pi, element, node, ctx); if (!sm.isNullCascaded(SVGCSSEngine.TEXT_DECORATION_INDEX)) setDecorationTextPaintInfo(pi, element); return pi; }
/** * Constructs a TextDecoration object for the specified element. This will * contain all of the decoration properties to be used when drawing the * text. */ protected TextPaintInfo getTextPaintInfo(Element element, GraphicsNode node, TextPaintInfo parentTPI, BridgeContext ctx) { // Force the engine to update stuff.. CSSUtilities.getComputedStyle (element, SVGCSSEngine.TEXT_DECORATION_INDEX); TextPaintInfo pi = new TextPaintInfo(parentTPI); // Was text-decoration explicity set on this element? StyleMap sm = ((CSSStylableElement)element).getComputedStyleMap(null); if ((sm.isNullCascaded(SVGCSSEngine.TEXT_DECORATION_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.FILL_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.STROKE_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.STROKE_WIDTH_INDEX)) && (sm.isNullCascaded(SVGCSSEngine.OPACITY_INDEX))) { // If not, keep the same decorations. return pi; } setBaseTextPaintInfo(pi, element, node, ctx); if (!sm.isNullCascaded(SVGCSSEngine.TEXT_DECORATION_INDEX)) setDecorationTextPaintInfo(pi, element); return pi; }
String pseudo, int propidx) { StyleMap sm = elt.getComputedStyleMap(pseudo); if (sm == null) { sm = getCascadedStyleMap(elt, pseudo);
String pseudo, int propidx) { StyleMap sm = elt.getComputedStyleMap(pseudo); if (sm == null) { sm = getCascadedStyleMap(elt, pseudo);
String pseudo, int propidx) { StyleMap sm = elt.getComputedStyleMap(pseudo); if (sm == null) { sm = getCascadedStyleMap(elt, pseudo);