Navigation via script may disable XHTML validation

Project:formsPlayer XForms Studio
Component:Miscellaneous
Category:bug
Priority:normal
Assigned:Unassigned
Status:active
Description

If navigation is invoked via assginment to document.location.href in a piece of script, it can have the effect that documents which are subsequently loaded do not go through XHTML validation process.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Further symptoms of this bug

Now that the source view has been implemented in standalone browser mode (as of 2.0.4), this bug also has the effect that the source view is left stuck on whichever document contained the offending piece of script.

Workaround

In order to work around this issue, the scripted assignment which causes the problem (or a call to the function in which it resides) may be placed into the onload handler of the body element. This postponement is sufficient for Sidewinder to correctly handle the navigation.

Document demonstrating the bug:

<html>
    <head>
        <title>
            Redirect
        </title>

        <script type="text/javascript">
            window.location.href = "http://skimstone.x-port.net/";
        </script>
    </head>

    <body>
    </body>
</html>

Document demonstrating the workaround:

<html>
    <head>
        <title>
            Redirect
        </title>

        <script type="text/javascript">
            function Redirect() {
                window.location.href = "http://skimstone.x-port.net/";
            }
        </script>
    </head>

    <body onload="Redirect();">
    </body>
</html>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.