michael@0: /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 sw=2 sts=2 et: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* List of SVG presentational attributes in the SVG 1.1 spec, for use in michael@0: mochitests. (These are the attributes that are mapped to CSS properties) */ michael@0: michael@0: var gMappedAttrList = michael@0: { michael@0: // NOTE: The list here should match the MappedAttributeEntry arrays in michael@0: // nsSVGElement.cpp michael@0: michael@0: // PresentationAttributes-FillStroke michael@0: fill: new AdditiveAttribute("fill", "XML", "rect"), michael@0: fill_opacity: new AdditiveAttribute("fill-opacity", "XML", "rect"), michael@0: fill_rule: new NonAdditiveAttribute("fill-rule", "XML", "rect"), michael@0: stroke: new AdditiveAttribute("stroke", "XML", "rect"), michael@0: stroke_dasharray: michael@0: new NonAdditiveAttribute("stroke-dasharray", "XML", "rect"), michael@0: stroke_dashoffset: new AdditiveAttribute("stroke-dashoffset", "XML", "rect"), michael@0: stroke_linecap: new NonAdditiveAttribute("stroke-linecap", "XML", "rect"), michael@0: stroke_linejoin: new NonAdditiveAttribute("stroke-linejoin", "XML", "rect"), michael@0: stroke_miterlimit: new AdditiveAttribute("stroke-miterlimit", "XML", "rect"), michael@0: stroke_opacity: new AdditiveAttribute("stroke-opacity", "XML", "rect"), michael@0: stroke_width: new AdditiveAttribute("stroke-width", "XML", "rect"), michael@0: michael@0: // PresentationAttributes-Graphics michael@0: clip_path: new NonAdditiveAttribute("clip-path", "XML", "rect"), michael@0: clip_rule: new NonAdditiveAttribute("clip-rule", "XML", "circle"), michael@0: color_interpolation: michael@0: new NonAdditiveAttribute("color-interpolation", "XML", "rect"), michael@0: cursor: new NonAdditiveAttribute("cursor", "XML", "rect"), michael@0: display: new NonAdditiveAttribute("display", "XML", "rect"), michael@0: filter: new NonAdditiveAttribute("filter", "XML", "rect"), michael@0: image_rendering: michael@0: NonAdditiveAttribute("image-rendering", "XML", "image"), michael@0: mask: new NonAdditiveAttribute("mask", "XML", "line"), michael@0: pointer_events: new NonAdditiveAttribute("pointer-events", "XML", "rect"), michael@0: shape_rendering: new NonAdditiveAttribute("shape-rendering", "XML", "rect"), michael@0: text_rendering: new NonAdditiveAttribute("text-rendering", "XML", "text"), michael@0: visibility: new NonAdditiveAttribute("visibility", "XML", "rect"), michael@0: michael@0: // PresentationAttributes-TextContentElements michael@0: // SKIP 'alignment-baseline' property: animatable but not supported by Mozilla michael@0: // SKIP 'baseline-shift' property: animatable but not supported by Mozilla michael@0: direction: new NonAnimatableAttribute("direction", "XML", "text"), michael@0: dominant_baseline: michael@0: new NonAdditiveAttribute("dominant-baseline", "XML", "text"), michael@0: glyph_orientation_horizontal: michael@0: // NOTE: Not supported by Mozilla, but explicitly non-animatable michael@0: NonAnimatableAttribute("glyph-orientation-horizontal", "XML", "text"), michael@0: glyph_orientation_vertical: michael@0: // NOTE: Not supported by Mozilla, but explicitly non-animatable michael@0: NonAnimatableAttribute("glyph-orientation-horizontal", "XML", "text"), michael@0: // SKIP 'kerning' property: animatable but not supported by Mozilla michael@0: letter_spacing: new AdditiveAttribute("letter-spacing", "XML", "text"), michael@0: text_anchor: new NonAdditiveAttribute("text-anchor", "XML", "text"), michael@0: text_decoration: new NonAdditiveAttribute("text-decoration", "XML", "text"), michael@0: unicode_bidi: new NonAnimatableAttribute("unicode-bidi", "XML", "text"), michael@0: word_spacing: new AdditiveAttribute("word-spacing", "XML", "text"), michael@0: michael@0: // PresentationAttributes-FontSpecification michael@0: font_family: new NonAdditiveAttribute("font-family", "XML", "text"), michael@0: font_size: new AdditiveAttribute("font-size", "XML", "text"), michael@0: font_size_adjust: michael@0: new NonAdditiveAttribute("font-size-adjust", "XML", "text"), michael@0: font_stretch: new NonAdditiveAttribute("font-stretch", "XML", "text"), michael@0: font_style: new NonAdditiveAttribute("font-style", "XML", "text"), michael@0: font_variant: new NonAdditiveAttribute("font-variant", "XML", "text"), michael@0: font_weight: new NonAdditiveAttribute("font-weight", "XML", "text"), michael@0: michael@0: // PresentationAttributes-GradientStop michael@0: stop_color: new AdditiveAttribute("stop-color", "XML", "stop"), michael@0: stop_opacity: new AdditiveAttribute("stop-opacity", "XML", "stop"), michael@0: michael@0: // PresentationAttributes-Viewports michael@0: overflow: new NonAdditiveAttribute("overflow", "XML", "marker"), michael@0: clip: new AdditiveAttribute("clip", "XML", "marker"), michael@0: michael@0: // PresentationAttributes-Makers michael@0: marker_end: new NonAdditiveAttribute("marker-end", "XML", "line"), michael@0: marker_mid: new NonAdditiveAttribute("marker-mid", "XML", "line"), michael@0: marker_start: new NonAdditiveAttribute("marker-start", "XML", "line"), michael@0: michael@0: // PresentationAttributes-Color michael@0: color: new AdditiveAttribute("color", "XML", "rect"), michael@0: michael@0: // PresentationAttributes-Filters michael@0: color_interpolation_filters: michael@0: new NonAdditiveAttribute("color-interpolation-filters", "XML", michael@0: "feFlood"), michael@0: michael@0: // PresentationAttributes-feFlood michael@0: flood_color: new AdditiveAttribute("flood-color", "XML", "feFlood"), michael@0: flood_opacity: new AdditiveAttribute("flood-opacity", "XML", "feFlood"), michael@0: michael@0: // PresentationAttributes-LightingEffects michael@0: lighting_color: michael@0: new AdditiveAttribute("lighting-color", "XML", "feDiffuseLighting"), michael@0: }; michael@0: michael@0: // Utility method to copy a list of TestcaseBundle objects for CSS properties michael@0: // into a list of TestcaseBundles for the corresponding mapped attributes. michael@0: function convertCSSBundlesToMappedAttr(bundleList) { michael@0: // Create mapping of property names to the corresponding michael@0: // mapped-attribute object in gMappedAttrList. michael@0: var propertyNameToMappedAttr = {}; michael@0: for (attributeLabel in gMappedAttrList) { michael@0: var propName = gMappedAttrList[attributeLabel].attrName; michael@0: propertyNameToMappedAttr[propName] = gMappedAttrList[attributeLabel]; michael@0: } michael@0: michael@0: var convertedBundles = []; michael@0: for (var bundleIdx in bundleList) { michael@0: var origBundle = bundleList[bundleIdx]; michael@0: var propName = origBundle.animatedAttribute.attrName; michael@0: if (propertyNameToMappedAttr[propName]) { michael@0: // There's a mapped attribute by this name! Duplicate the TestcaseBundle, michael@0: // using the Mapped Attribute instead of the CSS Property. michael@0: is(origBundle.animatedAttribute.attrType, "CSS", michael@0: "expecting to be converting from CSS to XML"); michael@0: convertedBundles.push( michael@0: new TestcaseBundle(propertyNameToMappedAttr[propName], michael@0: origBundle.testcaseList, michael@0: origBundle.skipReason)); michael@0: } michael@0: } michael@0: return convertedBundles; michael@0: }