On Dec 16, 2009, at 3:54 PM, David Pollak wrote:
> On Wed, Dec 16, 2009 at 11:55 AM, Ross Mellgren <dri...@gmail.com>  
> wrote:
> I agree I'm doing the wrong thing here -- the <lift:Dialog.head /> tag
> rightly should be outside of the head block, or the snippet should not
> emit <head>. However, the resulting behavior is funny (certainly more
> funny than I'd expect):
>
>
> <html xmlns:lift="http://liftweb.net/"; xmlns="http://www.w3.org/1999/xhtml
> ">
> <head>
> ...
> <title>Email Editor</title>
>
>
> <script type="text/javascript">
> // <![CDATA[
> var pxStandardDialogOptions = {"autoOpen": false, "bgiframe": true,
> "modal": true, "resizable": false};
> // ]]>
> </script>
>
>
> <head><script type="text/javascript">
> // <![CDATA[
> var pxStandardDialogOptions = {"autoOpen": false, "bgiframe": true,
> "modal": true, "resizable": false};
> // ]]>
> </script></head>
>
>
> </head>
> ...
> </html>
>
>
> Ideally I'd like this to "just work" so that it doesn't matter
> precisely where the snippet is called, though it would be some special
> magic just to work around an erroneous case. But, the behavior that
> does happen seems odd, duplicating the markup inside the <head>?
>
> Should I file a bug? Just smile and nod?
>
> If we had to recursively check all the <head> tags for <head> tags,  
> that would significantly increase the overhead of the rewrite  
> phase.  I would suggest using the new Helpers.stripHead() call to  
> remove <head> tags from stuff you already know is in a <head> tag.

We're pinned to 1.1-M8 now, and I don't think it has the method, but  
in any case I'm just going to remove the <head> from the snippet since  
the name of the snippet method implies it should be in the head already.

I was more curious whether the duplication of nodes is something that  
should be fixed or at least investigated. Having my snippet called  
once but chunks of its output appearing in two places surprised (and  
confused) me, it was only when I was creating a reproducible test case  
that I realized my mistake was the nested blocks, since the first  
appearance of the snippet output had no <head> around it so it  
appeared to be the right thing.

-Ross

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to