Chris@0: 1, Chris@17: 'abbr' => 1, Chris@17: 'address' => 65, // NORMAL | BLOCK_TAG Chris@17: 'area' => 9, // NORMAL | VOID_TAG Chris@17: 'article' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'aside' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'audio' => 1, // NORMAL Chris@17: 'b' => 1, Chris@17: 'base' => 9, // NORMAL | VOID_TAG Chris@17: 'bdi' => 1, Chris@17: 'bdo' => 1, Chris@17: 'blockquote' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'body' => 1, Chris@17: 'br' => 9, // NORMAL | VOID_TAG Chris@17: 'button' => 1, Chris@17: 'canvas' => 65, // NORMAL | BLOCK_TAG Chris@17: 'caption' => 1, Chris@17: 'cite' => 1, Chris@17: 'code' => 1, Chris@17: 'col' => 9, // NORMAL | VOID_TAG Chris@17: 'colgroup' => 1, Chris@17: 'command' => 9, // NORMAL | VOID_TAG Chris@0: // "data" => 1, // This is highly experimental and only part of the whatwg spec (not w3c). See https://developer.mozilla.org/en-US/docs/HTML/Element/data Chris@17: 'datalist' => 1, Chris@17: 'dd' => 65, // NORMAL | BLOCK_TAG Chris@17: 'del' => 1, Chris@17: 'details' => 17, // NORMAL | AUTOCLOSE_P, Chris@17: 'dfn' => 1, Chris@17: 'dialog' => 17, // NORMAL | AUTOCLOSE_P, Chris@17: 'div' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'dl' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'dt' => 1, Chris@17: 'em' => 1, Chris@17: 'embed' => 9, // NORMAL | VOID_TAG Chris@17: 'fieldset' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'figcaption' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'figure' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'footer' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'form' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'h1' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'h2' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'h3' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'h4' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'h5' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'h6' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'head' => 1, Chris@17: 'header' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'hgroup' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'hr' => 73, // NORMAL | VOID_TAG Chris@17: 'html' => 1, Chris@17: 'i' => 1, Chris@17: 'iframe' => 3, // NORMAL | TEXT_RAW Chris@17: 'img' => 9, // NORMAL | VOID_TAG Chris@17: 'input' => 9, // NORMAL | VOID_TAG Chris@17: 'kbd' => 1, Chris@17: 'ins' => 1, Chris@17: 'keygen' => 9, // NORMAL | VOID_TAG Chris@17: 'label' => 1, Chris@17: 'legend' => 1, Chris@17: 'li' => 1, Chris@17: 'link' => 9, // NORMAL | VOID_TAG Chris@17: 'map' => 1, Chris@17: 'mark' => 1, Chris@17: 'menu' => 17, // NORMAL | AUTOCLOSE_P, Chris@17: 'meta' => 9, // NORMAL | VOID_TAG Chris@17: 'meter' => 1, Chris@17: 'nav' => 17, // NORMAL | AUTOCLOSE_P, Chris@17: 'noscript' => 65, // NORMAL | BLOCK_TAG Chris@17: 'object' => 1, Chris@17: 'ol' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'optgroup' => 1, Chris@17: 'option' => 1, Chris@17: 'output' => 65, // NORMAL | BLOCK_TAG Chris@17: 'p' => 209, // NORMAL | AUTOCLOSE_P | BLOCK_TAG | BLOCK_ONLY_INLINE Chris@17: 'param' => 9, // NORMAL | VOID_TAG Chris@17: 'pre' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'progress' => 1, Chris@17: 'q' => 1, Chris@17: 'rp' => 1, Chris@17: 'rt' => 1, Chris@17: 'ruby' => 1, Chris@17: 's' => 1, Chris@17: 'samp' => 1, Chris@17: 'script' => 3, // NORMAL | TEXT_RAW Chris@17: 'section' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'select' => 1, Chris@17: 'small' => 1, Chris@17: 'source' => 9, // NORMAL | VOID_TAG Chris@17: 'span' => 1, Chris@17: 'strong' => 1, Chris@17: 'style' => 3, // NORMAL | TEXT_RAW Chris@17: 'sub' => 1, Chris@17: 'summary' => 17, // NORMAL | AUTOCLOSE_P, Chris@17: 'sup' => 1, Chris@17: 'table' => 65, // NORMAL | BLOCK_TAG Chris@17: 'tbody' => 1, Chris@17: 'td' => 1, Chris@17: 'textarea' => 5, // NORMAL | TEXT_RCDATA Chris@17: 'tfoot' => 65, // NORMAL | BLOCK_TAG Chris@17: 'th' => 1, Chris@17: 'thead' => 1, Chris@17: 'time' => 1, Chris@17: 'title' => 5, // NORMAL | TEXT_RCDATA Chris@17: 'tr' => 1, Chris@17: 'track' => 9, // NORMAL | VOID_TAG Chris@17: 'u' => 1, Chris@17: 'ul' => 81, // NORMAL | AUTOCLOSE_P | BLOCK_TAG Chris@17: 'var' => 1, Chris@17: 'video' => 65, // NORMAL | BLOCK_TAG Chris@17: 'wbr' => 9, // NORMAL | VOID_TAG Chris@0: Chris@0: // Legacy? Chris@0: 'basefont' => 8, // VOID_TAG Chris@0: 'bgsound' => 8, // VOID_TAG Chris@0: 'noframes' => 2, // RAW_TEXT Chris@0: 'frame' => 9, // NORMAL | VOID_TAG Chris@0: 'frameset' => 1, Chris@0: 'center' => 16, Chris@0: 'dir' => 16, Chris@0: 'listing' => 16, // AUTOCLOSE_P Chris@0: 'plaintext' => 48, // AUTOCLOSE_P | TEXT_PLAINTEXT Chris@0: 'applet' => 0, Chris@0: 'marquee' => 0, Chris@0: 'isindex' => 8, // VOID_TAG Chris@0: 'xmp' => 20, // AUTOCLOSE_P | VOID_TAG | RAW_TEXT Chris@17: 'noembed' => 2, // RAW_TEXT Chris@0: ); Chris@0: Chris@0: /** Chris@0: * The MathML elements. Chris@0: * See http://www.w3.org/wiki/MathML/Elements. Chris@0: * Chris@0: * In our case we are only concerned with presentation MathML and not content Chris@0: * MathML. There is a nice list of this subset at https://developer.mozilla.org/en-US/docs/MathML/Element. Chris@0: * Chris@0: * @var array Chris@0: */ Chris@0: public static $mathml = array( Chris@17: 'maction' => 1, Chris@17: 'maligngroup' => 1, Chris@17: 'malignmark' => 1, Chris@17: 'math' => 1, Chris@17: 'menclose' => 1, Chris@17: 'merror' => 1, Chris@17: 'mfenced' => 1, Chris@17: 'mfrac' => 1, Chris@17: 'mglyph' => 1, Chris@17: 'mi' => 1, Chris@17: 'mlabeledtr' => 1, Chris@17: 'mlongdiv' => 1, Chris@17: 'mmultiscripts' => 1, Chris@17: 'mn' => 1, Chris@17: 'mo' => 1, Chris@17: 'mover' => 1, Chris@17: 'mpadded' => 1, Chris@17: 'mphantom' => 1, Chris@17: 'mroot' => 1, Chris@17: 'mrow' => 1, Chris@17: 'ms' => 1, Chris@17: 'mscarries' => 1, Chris@17: 'mscarry' => 1, Chris@17: 'msgroup' => 1, Chris@17: 'msline' => 1, Chris@17: 'mspace' => 1, Chris@17: 'msqrt' => 1, Chris@17: 'msrow' => 1, Chris@17: 'mstack' => 1, Chris@17: 'mstyle' => 1, Chris@17: 'msub' => 1, Chris@17: 'msup' => 1, Chris@17: 'msubsup' => 1, Chris@17: 'mtable' => 1, Chris@17: 'mtd' => 1, Chris@17: 'mtext' => 1, Chris@17: 'mtr' => 1, Chris@17: 'munder' => 1, Chris@17: 'munderover' => 1, Chris@0: ); Chris@0: Chris@0: /** Chris@0: * The svg elements. Chris@0: * Chris@0: * The Mozilla documentation has a good list at https://developer.mozilla.org/en-US/docs/SVG/Element. Chris@0: * The w3c list appears to be lacking in some areas like filter effect elements. Chris@0: * That list can be found at http://www.w3.org/wiki/SVG/Elements. Chris@0: * Chris@0: * Note, FireFox appears to do a better job rendering filter effects than chrome. Chris@0: * While they are in the spec I'm not sure how widely implemented they are. Chris@0: * Chris@0: * @var array Chris@0: */ Chris@0: public static $svg = array( Chris@17: 'a' => 1, Chris@17: 'altGlyph' => 1, Chris@17: 'altGlyphDef' => 1, Chris@17: 'altGlyphItem' => 1, Chris@17: 'animate' => 1, Chris@17: 'animateColor' => 1, Chris@17: 'animateMotion' => 1, Chris@17: 'animateTransform' => 1, Chris@17: 'circle' => 1, Chris@17: 'clipPath' => 1, Chris@17: 'color-profile' => 1, Chris@17: 'cursor' => 1, Chris@17: 'defs' => 1, Chris@17: 'desc' => 1, Chris@17: 'ellipse' => 1, Chris@17: 'feBlend' => 1, Chris@17: 'feColorMatrix' => 1, Chris@17: 'feComponentTransfer' => 1, Chris@17: 'feComposite' => 1, Chris@17: 'feConvolveMatrix' => 1, Chris@17: 'feDiffuseLighting' => 1, Chris@17: 'feDisplacementMap' => 1, Chris@17: 'feDistantLight' => 1, Chris@17: 'feFlood' => 1, Chris@17: 'feFuncA' => 1, Chris@17: 'feFuncB' => 1, Chris@17: 'feFuncG' => 1, Chris@17: 'feFuncR' => 1, Chris@17: 'feGaussianBlur' => 1, Chris@17: 'feImage' => 1, Chris@17: 'feMerge' => 1, Chris@17: 'feMergeNode' => 1, Chris@17: 'feMorphology' => 1, Chris@17: 'feOffset' => 1, Chris@17: 'fePointLight' => 1, Chris@17: 'feSpecularLighting' => 1, Chris@17: 'feSpotLight' => 1, Chris@17: 'feTile' => 1, Chris@17: 'feTurbulence' => 1, Chris@17: 'filter' => 1, Chris@17: 'font' => 1, Chris@17: 'font-face' => 1, Chris@17: 'font-face-format' => 1, Chris@17: 'font-face-name' => 1, Chris@17: 'font-face-src' => 1, Chris@17: 'font-face-uri' => 1, Chris@17: 'foreignObject' => 1, Chris@17: 'g' => 1, Chris@17: 'glyph' => 1, Chris@17: 'glyphRef' => 1, Chris@17: 'hkern' => 1, Chris@17: 'image' => 1, Chris@17: 'line' => 1, Chris@17: 'linearGradient' => 1, Chris@17: 'marker' => 1, Chris@17: 'mask' => 1, Chris@17: 'metadata' => 1, Chris@17: 'missing-glyph' => 1, Chris@17: 'mpath' => 1, Chris@17: 'path' => 1, Chris@17: 'pattern' => 1, Chris@17: 'polygon' => 1, Chris@17: 'polyline' => 1, Chris@17: 'radialGradient' => 1, Chris@17: 'rect' => 1, Chris@17: 'script' => 3, // NORMAL | RAW_TEXT Chris@17: 'set' => 1, Chris@17: 'stop' => 1, Chris@17: 'style' => 3, // NORMAL | RAW_TEXT Chris@17: 'svg' => 1, Chris@17: 'switch' => 1, Chris@17: 'symbol' => 1, Chris@17: 'text' => 1, Chris@17: 'textPath' => 1, Chris@17: 'title' => 1, Chris@17: 'tref' => 1, Chris@17: 'tspan' => 1, Chris@17: 'use' => 1, Chris@17: 'view' => 1, Chris@17: 'vkern' => 1, Chris@0: ); Chris@0: Chris@0: /** Chris@17: * Some attributes in SVG are case sensitive. Chris@0: * Chris@0: * This map contains key/value pairs with the key as the lowercase attribute Chris@0: * name and the value with the correct casing. Chris@0: */ Chris@0: public static $svgCaseSensitiveAttributeMap = array( Chris@0: 'attributename' => 'attributeName', Chris@0: 'attributetype' => 'attributeType', Chris@0: 'basefrequency' => 'baseFrequency', Chris@0: 'baseprofile' => 'baseProfile', Chris@0: 'calcmode' => 'calcMode', Chris@0: 'clippathunits' => 'clipPathUnits', Chris@0: 'contentscripttype' => 'contentScriptType', Chris@0: 'contentstyletype' => 'contentStyleType', Chris@0: 'diffuseconstant' => 'diffuseConstant', Chris@0: 'edgemode' => 'edgeMode', Chris@0: 'externalresourcesrequired' => 'externalResourcesRequired', Chris@0: 'filterres' => 'filterRes', Chris@0: 'filterunits' => 'filterUnits', Chris@0: 'glyphref' => 'glyphRef', Chris@0: 'gradienttransform' => 'gradientTransform', Chris@0: 'gradientunits' => 'gradientUnits', Chris@0: 'kernelmatrix' => 'kernelMatrix', Chris@0: 'kernelunitlength' => 'kernelUnitLength', Chris@0: 'keypoints' => 'keyPoints', Chris@0: 'keysplines' => 'keySplines', Chris@0: 'keytimes' => 'keyTimes', Chris@0: 'lengthadjust' => 'lengthAdjust', Chris@0: 'limitingconeangle' => 'limitingConeAngle', Chris@0: 'markerheight' => 'markerHeight', Chris@0: 'markerunits' => 'markerUnits', Chris@0: 'markerwidth' => 'markerWidth', Chris@0: 'maskcontentunits' => 'maskContentUnits', Chris@0: 'maskunits' => 'maskUnits', Chris@0: 'numoctaves' => 'numOctaves', Chris@0: 'pathlength' => 'pathLength', Chris@0: 'patterncontentunits' => 'patternContentUnits', Chris@0: 'patterntransform' => 'patternTransform', Chris@0: 'patternunits' => 'patternUnits', Chris@0: 'pointsatx' => 'pointsAtX', Chris@0: 'pointsaty' => 'pointsAtY', Chris@0: 'pointsatz' => 'pointsAtZ', Chris@0: 'preservealpha' => 'preserveAlpha', Chris@0: 'preserveaspectratio' => 'preserveAspectRatio', Chris@0: 'primitiveunits' => 'primitiveUnits', Chris@0: 'refx' => 'refX', Chris@0: 'refy' => 'refY', Chris@0: 'repeatcount' => 'repeatCount', Chris@0: 'repeatdur' => 'repeatDur', Chris@0: 'requiredextensions' => 'requiredExtensions', Chris@0: 'requiredfeatures' => 'requiredFeatures', Chris@0: 'specularconstant' => 'specularConstant', Chris@0: 'specularexponent' => 'specularExponent', Chris@0: 'spreadmethod' => 'spreadMethod', Chris@0: 'startoffset' => 'startOffset', Chris@0: 'stddeviation' => 'stdDeviation', Chris@0: 'stitchtiles' => 'stitchTiles', Chris@0: 'surfacescale' => 'surfaceScale', Chris@0: 'systemlanguage' => 'systemLanguage', Chris@0: 'tablevalues' => 'tableValues', Chris@0: 'targetx' => 'targetX', Chris@0: 'targety' => 'targetY', Chris@0: 'textlength' => 'textLength', Chris@0: 'viewbox' => 'viewBox', Chris@0: 'viewtarget' => 'viewTarget', Chris@0: 'xchannelselector' => 'xChannelSelector', Chris@0: 'ychannelselector' => 'yChannelSelector', Chris@17: 'zoomandpan' => 'zoomAndPan', Chris@0: ); Chris@0: Chris@0: /** Chris@17: * Some SVG elements are case sensitive. Chris@0: * This map contains these. Chris@0: * Chris@0: * The map contains key/value store of the name is lowercase as the keys and Chris@0: * the correct casing as the value. Chris@0: */ Chris@0: public static $svgCaseSensitiveElementMap = array( Chris@0: 'altglyph' => 'altGlyph', Chris@0: 'altglyphdef' => 'altGlyphDef', Chris@0: 'altglyphitem' => 'altGlyphItem', Chris@0: 'animatecolor' => 'animateColor', Chris@0: 'animatemotion' => 'animateMotion', Chris@0: 'animatetransform' => 'animateTransform', Chris@0: 'clippath' => 'clipPath', Chris@0: 'feblend' => 'feBlend', Chris@0: 'fecolormatrix' => 'feColorMatrix', Chris@0: 'fecomponenttransfer' => 'feComponentTransfer', Chris@0: 'fecomposite' => 'feComposite', Chris@0: 'feconvolvematrix' => 'feConvolveMatrix', Chris@0: 'fediffuselighting' => 'feDiffuseLighting', Chris@0: 'fedisplacementmap' => 'feDisplacementMap', Chris@0: 'fedistantlight' => 'feDistantLight', Chris@0: 'feflood' => 'feFlood', Chris@0: 'fefunca' => 'feFuncA', Chris@0: 'fefuncb' => 'feFuncB', Chris@0: 'fefuncg' => 'feFuncG', Chris@0: 'fefuncr' => 'feFuncR', Chris@0: 'fegaussianblur' => 'feGaussianBlur', Chris@0: 'feimage' => 'feImage', Chris@0: 'femerge' => 'feMerge', Chris@0: 'femergenode' => 'feMergeNode', Chris@0: 'femorphology' => 'feMorphology', Chris@0: 'feoffset' => 'feOffset', Chris@0: 'fepointlight' => 'fePointLight', Chris@0: 'fespecularlighting' => 'feSpecularLighting', Chris@0: 'fespotlight' => 'feSpotLight', Chris@0: 'fetile' => 'feTile', Chris@0: 'feturbulence' => 'feTurbulence', Chris@0: 'foreignobject' => 'foreignObject', Chris@0: 'glyphref' => 'glyphRef', Chris@0: 'lineargradient' => 'linearGradient', Chris@0: 'radialgradient' => 'radialGradient', Chris@17: 'textpath' => 'textPath', Chris@0: ); Chris@0: Chris@0: /** Chris@0: * Check whether the given element meets the given criterion. Chris@0: * Chris@0: * Example: Chris@0: * Chris@0: * Elements::isA('script', Elements::TEXT_RAW); // Returns true. Chris@0: * Chris@0: * Elements::isA('script', Elements::TEXT_RCDATA); // Returns false. Chris@0: * Chris@17: * @param string $name The element name. Chris@17: * @param int $mask One of the constants on this class. Chris@17: * Chris@17: * @return bool true if the element matches the mask, false otherwise. Chris@0: */ Chris@0: public static function isA($name, $mask) Chris@0: { Chris@17: return (static::element($name) & $mask) === $mask; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Test if an element is a valid html5 element. Chris@0: * Chris@17: * @param string $name The name of the element. Chris@0: * Chris@17: * @return bool true if a html5 element and false otherwise. Chris@0: */ Chris@0: public static function isHtml5Element($name) Chris@0: { Chris@17: // html5 element names are case insensitive. Forcing lowercase for the check. Chris@0: // Do we need this check or will all data passed here already be lowercase? Chris@0: return isset(static::$html5[strtolower($name)]); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Test if an element name is a valid MathML presentation element. Chris@0: * Chris@17: * @param string $name The name of the element. Chris@0: * Chris@17: * @return bool true if a MathML name and false otherwise. Chris@0: */ Chris@0: public static function isMathMLElement($name) Chris@0: { Chris@17: // MathML is case-sensitive unlike html5 elements. Chris@0: return isset(static::$mathml[$name]); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Test if an element is a valid SVG element. Chris@0: * Chris@17: * @param string $name The name of the element. Chris@0: * Chris@17: * @return bool true if a SVG element and false otherise. Chris@0: */ Chris@0: public static function isSvgElement($name) Chris@0: { Chris@17: // SVG is case-sensitive unlike html5 elements. Chris@0: return isset(static::$svg[$name]); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Is an element name valid in an html5 document. Chris@0: * This includes html5 elements along with other allowed embedded content Chris@0: * such as svg and mathml. Chris@0: * Chris@17: * @param string $name The name of the element. Chris@0: * Chris@17: * @return bool true if valid and false otherwise. Chris@0: */ Chris@0: public static function isElement($name) Chris@0: { Chris@0: return static::isHtml5Element($name) || static::isMathMLElement($name) || static::isSvgElement($name); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Get the element mask for the given element name. Chris@0: * Chris@17: * @param string $name The name of the element. Chris@0: * Chris@17: * @return int the element mask. Chris@0: */ Chris@0: public static function element($name) Chris@0: { Chris@0: if (isset(static::$html5[$name])) { Chris@0: return static::$html5[$name]; Chris@0: } Chris@0: if (isset(static::$svg[$name])) { Chris@0: return static::$svg[$name]; Chris@0: } Chris@0: if (isset(static::$mathml[$name])) { Chris@0: return static::$mathml[$name]; Chris@0: } Chris@0: Chris@17: return 0; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Normalize a SVG element name to its proper case and form. Chris@0: * Chris@17: * @param string $name The name of the element. Chris@0: * Chris@17: * @return string the normalized form of the element name. Chris@0: */ Chris@0: public static function normalizeSvgElement($name) Chris@0: { Chris@0: $name = strtolower($name); Chris@0: if (isset(static::$svgCaseSensitiveElementMap[$name])) { Chris@0: $name = static::$svgCaseSensitiveElementMap[$name]; Chris@0: } Chris@0: Chris@0: return $name; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Normalize a SVG attribute name to its proper case and form. Chris@0: * Chris@17: * @param string $name The name of the attribute. Chris@0: * Chris@0: * @return string The normalized form of the attribute name. Chris@0: */ Chris@0: public static function normalizeSvgAttribute($name) Chris@0: { Chris@0: $name = strtolower($name); Chris@0: if (isset(static::$svgCaseSensitiveAttributeMap[$name])) { Chris@0: $name = static::$svgCaseSensitiveAttributeMap[$name]; Chris@0: } Chris@0: Chris@0: return $name; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Normalize a MathML attribute name to its proper case and form. Chris@0: * Note, all MathML element names are lowercase. Chris@0: * Chris@17: * @param string $name The name of the attribute. Chris@0: * Chris@0: * @return string The normalized form of the attribute name. Chris@0: */ Chris@0: public static function normalizeMathMlAttribute($name) Chris@0: { Chris@0: $name = strtolower($name); Chris@0: Chris@0: // Only one attribute has a mixed case form for MathML. Chris@17: if ('definitionurl' === $name) { Chris@0: $name = 'definitionURL'; Chris@0: } Chris@0: Chris@0: return $name; Chris@0: } Chris@0: }