W3C home > Mailing lists > Public > uri@w3.org > November 2006

Re: The 'javascript' scheme

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sun, 05 Nov 2006 23:10:40 +0100
To: Paul Hoffman <phoffman@imc.org>
Cc: uri@w3.org, uri-review@ietf.org
Message-ID: <avksk25niqign75i2ta8m3kp587o1gsgnl@hive.bjoern.hoehrmann.de>

* Paul Hoffman wrote:
>At 7:50 PM +0100 11/5/06, Bjoern Hoehrmann wrote:
>>It does address the '#', '/', and BOM cases, there are no other
>>interesting cases and there are several examples, valid and invalid.
>
>I see two examples, one valid and one invalid. A section of examples 
>reinforcing the rules would probably be very helpful. We certainly 
>found this to be the case for the mailto: URI specification.

You can use any character allowed in IRIs in the scheme-specific part,
and in most cases you can use any character so long as the result is a
valid javascript program. As an example, there is nothing wrong with

  xlink:href="javascript:if (foo == 'Björn') { ... }"

in an XML document, because the XLink specification requires to percent-
encode all disallowed characters before processing the attribute value
as resource identifier. So if I had an example that reinforces that you
cannot use spaces or curly braces in resource identifiers, it would mis-
lead many readers of the specification because the rules do not affect
them. The draft even suggests to extend this for

  example="javascript:_scrollTo('#example')"

so that "example" would not be considered a fragment identifier, which
is necessary for many real world documents. So the only invalid examples
that would not require elaborate discussion to ensure not to mislead
readers would be examples with UTF-8 errors and with invalid javascript
code. I think that you cannot use invalid javascript is trivial, and
UTF-8 errors alone don't merit discussion. That leaves us with valid
examples; I don't know of any that both demonstrates good use of the
scheme and is short enough to fit a single line. Long examples would
then have to explain how line wraps and indentation are to be ignored.

In http://www.ietf.org/internet-drafts/draft-hoehrmann-urlencoded-00.txt
I have an extensive set of examples that demonstrate just about any edge
case making the set of examples a suitable initial test suite, and I do
agree that this is very helpful to clarify certain aspects of the spec,
but I do not see how I could construct something similar for the 'java-
script' scheme specification. In the end there are no non-trivial rules
that I could reinforce.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Sunday, 5 November 2006 22:10:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:10 UTC