[techexplorer-support] Re[4]: <mstyle> problem

Aleksey news4al at freemail.ru
Mon Jul 25 12:47:04 MDT 2005


Hello Sam,

Monday, July 25, 2005, 5:44:02 PM, you wrote:

SD> The literal string "inherit" is not a valid value for the mathbackground
SD> attribute.  Where the MathML specification lists an attribute as inherited,
SD> the text of the specification describes how to calculate the effective value
SD> of the attribute for the given element.

SD> If you want the background color of an element to inherit from the background
SD> color of its parent, set the mathbackground attribute to the empty string.

Seems like it does not work properly. Pleese see the following code:
---------------------------------------------------------------------------------
<html xmlns:m>
<head>
<object name="mml" classid="clsid:0E76D59A-C088-11D4-9920-002035EFB1A4"></object>
<?import namespace="m" implementation="#mml" ?>
<title>Integre Techexplorer Testbed</title>
<script language="JavaScript" type="text/javascript">
function handleClick() 
{
        var elts = document.getElementsByTagName("math");
        var math = elts[0];

        var o = document.getElementById("outer");
        var i = document.getElementById("inner");
        //alert(o.mathbackground);

        // Get the browser value for the mathbackground attribute
        var color1 = o.mathbackground;
        var color2 = i.mathbackground;

        // Change the browser value for the mathbackground attribute
        o.mathbackground = color2;
        i.mathbackground = color1;

        // Change the behavior value for the mathbackground attribute
        o.setAttribute( "mathbackground", color2 );
        i.setAttribute( "mathbackground", color1 );

        math.validateMml();
}
</script>
</head>
<body>
<h2>Scripting</h2>
<div>
    <m:math>
    <m:mstyle id="outer" mathbackground="">
    <m:mrow>
        <m:mo>(</m:mo>
        <m:mstyle id="inner" mathbackground="green">
        <m:mrow>
            <m:mi>a</m:mi>
            <m:mo>+</m:mo>
            <m:mi>b</m:mi>
        </m:mrow>
        </m:mstyle>
        <m:mo>)</m:mo>
    </m:mrow>
    </m:mstyle>
    </m:math>
</div>
<p><form>
    <input type="button" value="Swap mstyle's background color" onClick="handleClick()">
</form></p>
</body>
</html>
---------------------------------------------------------------------------------

If I specify for outer mstyle tag mathbacground="yellow" it does work
properly. But if I specify empty string it does not work.

What do I wrong?

-- 
Best regards,
 Aleksey                            mailto:news4al at freemail.ru




More information about the techexplorer-support mailing list