[Webkit-unassigned] [Bug 32706] <noscript> is taking effect even though the Javascript is enabled, when XHTMLMP is enabled

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 23 11:05:11 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32706





--- Comment #10 from Daniel Bates <dbates at webkit.org>  2009-12-23 11:05:10 PST ---
(In reply to comment #0)
> <noscript> is designed for browsers that doesn't support Javascript , or
> Javascript is  disabled.   But It's working even when Javascript is enabled
> with WebKit,  this happens when XHTMLMP is enabled.
> 
> to verify ,  use the following html snippets:
> 
> <html>
> <noscript>
>     <meta http-equiv=refresh content="0; URL=http://www.google.com" />
> </noscript>
> 
> <body>
>     If you see this text and not re-directed to google when your browser is
> Javascript enabled, it succeeds,  otherwise it fails .
> </body>
> </html>

I am unclear from your snippet whether this is a valid XHTML-MP document and
whether this document would or should be interpreted as being an XHTML-MP
document. I mean, it's missing a DOCTYPE and an xml namespace. So, how does the
browser know to interpret this as XHTML-MP? by file extension? by MIME type
"application/vnd.wap.xhtml+xml"? when XHTML-MP is enabled in WebKit do we just
interpret all documents as XHTML-MP? some combination?

(I briefly looked through some of the XHTML-MP code, and from my understanding,
it looks for the DOCTYPE and xml namespace declarations as well as accepts the
MIME type "application/vnd.wap.xhtml+xml".)

I would suggest only using the XHTML-MP logic when we clearly know that the
document we received is an XHTML-MP document since by the HTML 5 spec.
<noscript> has a precisely defined behavior under HTML, but has no meaning
under XHTML (*). Hence, the expected result of interpreting your example as
XHTML should be a redirect (regardless of whether JavaScript is enabled). And
the expected result of interpreting the document as HTML with JavaScript
enabled is no redirect.

Assuming JavaScript is enabled, then interpreting your example as an XHTML-MP
document should not cause a redirect. But, consider the slightly modified
example:

<html>
 <script type="unsupported-script-lang">...</script>
 <noscript>
     <meta http-equiv=refresh content="0; URL=http://www.google.com" />
 </noscript>

 <body>
     If you see this text and not re-directed to google when your browser is
 Javascript enabled, it succeeds,  otherwise it fails .
 </body>
</html>

Assume JavaScript is enabled and suppose this is interpreted as being an
XHTML-MP document. Then by section 9.2.1.2 of the XHTML-MP 1.1
spec.<http://www.openmobilealliance.org/Technical/release_program/docs/Browsing/V2_2-20061020-A/OMA-WAP-XHTMLMP-V1_1-20061020-A.pdf>,
we must process the <noscript> since we first encountered a <script> with an
unsupported scripting language (i.e. "unsupported-script-lang"). So, the
expected result is a redirect.

(*) Section 4.3.2 of the HTML 5 spec. states "...the noscript element is
handled differently by the HTML parser based on whether scripting was enabled
or not when the parser was invoked....The noscript element is only effective in
the HTML syntax, it has no effect in the XHTML syntax"
(http://dev.w3.org/html5/spec/Overview.html#the-noscript-element).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list