struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: xhtml javascript hiding methods
Date Mon, 20 Jan 2003 05:10:33 GMT
Fair enough but the sad reality is that the major browsers I've tried this 
in are badly broken.  I'll make the change to ignore the htmlComment setting 
in xhtml mode and put this issue to rest.

David






>From: Martin Cooper <martinc@apache.org>
>Reply-To: "Struts Developers List" <struts-dev@jakarta.apache.org>
>To: Struts Developers List <struts-dev@jakarta.apache.org>
>Subject: Re: xhtml javascript hiding methods
>Date: Sun, 19 Jan 2003 20:59:00 -0800 (PST)
>
>
>
>On Sun, 19 Jan 2003, David Graham wrote:
>
> > Thank you for reconsidering Martin :-).  What about the situation where 
>you
> > want HTML browsers to read the script but also want to be able to 
>validate
> > the page as XHTML?  In this case, your main goal is to provide backwards
> > compatibility while moving into the world of XHTML.  Remember that one 
>of
> > the goals of XHTML is that existing browsers be able to read it.
>
>You are referring to a case in which the browser would have to be truly
>broken. It knows enough about XHTML to allow for XML syntax of pages, but
>doesn't know enough about regular HTML to know about scripts. I'm not at
>all interested in supporting such a beast.
>
>To achieve what you describe, running an XSL transform would attain both
>goals in a single step - validate that you started with X(HT)ML, and
>generate HTML that older browsers would support, complete with comments
>around the scripts.
>
>--
>Martin Cooper
>
>
> >
> > The requirement that the htmlComment attribute be ignored in XHTML mode 
>does
> > not allow for the above situation.
> >
> > Thanks,
> > Dave
> >
> > >My original intent was indeed to veto the change. Since then, I have
> > >re-read the spec and realised that the normative section does not 
>mandate
> > >CDATA, while the section that appears to mandate it is in fact 
>informative
> > >rather than normative.
> > >
> > >However, I'm not quite ready to +1 the change as is. As Craig pointed 
>out,
> > >the use of comments to hide script in XHTML will cause it to be dropped
> > >entirely if the page is processed using an XML processor. Further, any
> > >browser that's going to be useful with XHTML will support scripts, so
> > >there is no reason to enclose the scripts in comments. (Recall that the
> > >original reason for using comments was to prevent the script from being
> > >rendered as content by browsers that didn't know what that was.) 
>Finally,
> > >note that using the script directly, with neither comments nor CDATA 
>works
> > >fine with current browsers.
> > >
> > >My proposal, therefore, is to leave the 'cdata' attribute, but to 
>change
> > >the tag behaviours slightly. If XHTML is being generated, then the 
>'cdata'
> > >attribute determines whether or not script is wrapped in a CDATA block.
> > >Ostensibly, this allows the user to specify when prevention of markup
> > >processing within the script block is necessary. The default should be
> > >'true', as it is currently. In addition, if XHTML is being generated, 
>then
> > >the 'htmlComment' attribute should be ignored, and script blocks never
> > >wrapped in HTML comments.
> > >
> > >With the above change, I will remove my -1 on the original changes.
> > >
> > >--
> > >Martin Cooper
> > >
> > >
> > > >
> > > > David
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > >From: Martin Cooper <martinc@apache.org>
> > > > >Reply-To: "Struts Developers List" <struts-dev@jakarta.apache.org>
> > > > >To: Struts Developers List <struts-dev@jakarta.apache.org>
> > > > >Subject: Re: xhtml javascript hiding methods
> > > > >Date: Thu, 16 Jan 2003 20:51:27 -0800 (PST)
> > > > >
> > > > >
> > > > >
> > > > >On Thu, 16 Jan 2003, David Graham wrote:
> > > > >
> > > > > > Ok, what do you think about a boolean "cdata" attribute for
the
> > > > >javascript
> > > > > > tag?  I think this will accomodate everyone's needs.
> > > > >
> > > > >You mean add a "violate the spec to keep some browsers happy"
> > >attribute?
> > > > >-1.
> > > > >
> > > > >--
> > > > >Martin Cooper
> > > > >
> > > > >
> > > > > >
> > > > > > What do you mean that no browsers implement xhtml correctly?
 
>What
> > >are
> > > > >they
> > > > > > missing?  Opera writes its own pages in strict xhtml and their
> > >browser
> > > > > > supports it.
> > > > > >
> > > > > > Dave
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > >From: "Craig R. McClanahan" <craigmcc@apache.org>
> > > > > > >Reply-To: "Struts Developers List" 
><struts-dev@jakarta.apache.org>
> > > > > > >To: Struts Developers List <struts-dev@jakarta.apache.org>
> > > > > > >Subject: Re: xhtml javascript hiding methods
> > > > > > >Date: Wed, 15 Jan 2003 23:04:45 -0800 (PST)
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >On Wed, 15 Jan 2003, David Graham wrote:
> > > > > > >
> > > > > > > > Date: Wed, 15 Jan 2003 23:35:27 -0700
> > > > > > > > From: David Graham <dgraham1980@hotmail.com>
> > > > > > > > Reply-To: Struts Developers List 
><struts-dev@jakarta.apache.org>
> > > > > > > > To: struts-dev@jakarta.apache.org
> > > > > > > > Subject: xhtml javascript hiding methods
> > > > > > > >
> > > > > > > > Well, here are the choices as I understand them:
> > > > > > > >
> > > > > > > > 1.  Use CDATA to hide the javascript and make it completely
> > >useless
> > > > >in
> > > > > > > > current browsers.
> > > > > > > >
> > > > > > > > 2.  Use a comment to hide the javascript which allows

>current
> > > > >browsers
> > > > > > >to
> > > > > > > > work and xml parsers.
> > > > > > > >
> > > > > > > > The xhtml spec does suggest using CDATA but I don't
see a 
>reason
> > >the
> > > > > > >comment
> > > > > > > > method won't work.
> > > > > > > >
> > > > > > >
> > > > > > >If you are using XML-based technologies like XSLT to transform
> > >things
> > > > >to
> > > > > > >create your output pages, the "commented out" text inside
a
> > ><script>
> > > > > > >element is going to get dropped on the floor.
> > > > > > >
> > > > > > >What I also don't understand is why anybody is worried about
> > >generating
> > > > > > >XHTML markup for the current generation of popular browsers,

>none
> > >of
> > > > >which
> > > > > > >implement it correctly ... but that's a different issue.
> > > > > > >
> > > > > > > > Dave
> > > > > > >
> > > > > > >Craig
> > > > > > >
> > > > > > >
> > > > > > >--
> > > > > > >To unsubscribe, e-mail:
> > > > > > ><mailto:struts-dev-unsubscribe@jakarta.apache.org>
> > > > > > >For additional commands, e-mail:
> > > > > > ><mailto:struts-dev-help@jakarta.apache.org>
> > > > > >
> > > > > >
> > > > > > 
>_________________________________________________________________
> > > > > > MSN 8: advanced junk mail protection and 2 months FREE*.
> > > > > > http://join.msn.com/?page=features/junkmail
> > > > > >
> > > > > >
> > > > > > --
> > > > > > To unsubscribe, e-mail:
> > > > ><mailto:struts-dev-unsubscribe@jakarta.apache.org>
> > > > > > For additional commands, e-mail:
> > > > ><mailto:struts-dev-help@jakarta.apache.org>
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >--
> > > > >To unsubscribe, e-mail:
> > > > ><mailto:struts-dev-unsubscribe@jakarta.apache.org>
> > > > >For additional commands, e-mail:
> > > > ><mailto:struts-dev-help@jakarta.apache.org>
> > > >
> > > >
> > > > _________________________________________________________________
> > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > http://join.msn.com/?page=features/virus
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > ><mailto:struts-dev-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > ><mailto:struts-dev-help@jakarta.apache.org>
> > > >
> > > >
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:
> > ><mailto:struts-dev-unsubscribe@jakarta.apache.org>
> > >For additional commands, e-mail:
> > ><mailto:struts-dev-help@jakarta.apache.org>
> >
> >
> > _________________________________________________________________
> > MSN 8 with e-mail virus protection service: 2 months FREE*
> > http://join.msn.com/?page=features/virus
> >
> >
> > --
> > To unsubscribe, e-mail:   
><mailto:struts-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: 
><mailto:struts-dev-help@jakarta.apache.org>
> >
> >
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-dev-help@jakarta.apache.org>


_________________________________________________________________
MSN 8: advanced junk mail protection and 2 months FREE*. 
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message