[whatwg] AppCache and javascript url question?

On Wed, 1 Jul 2009, Michael Nordman wrote:
> On Tue, Jun 30, 2009 at 9:29 PM, Ian Hickson <ian at hixie.ch> wrote:
> > On Thu, 4 Jun 2009, Michael Nordman wrote:
> > >
> > > What appcache (if any) should the resulting iframes be associated with? I
> > > think per the spec, the answer is none. Is that the correct answer?
> > >
> > > <html manifest='myManifestFile'>
> > > <body>
> > > <script language="JavaScript">
> > >   function frameContents1()
> > >   {
> > >     var doc = frame1.document;
> > >     doc.open();
> > >     doc.write('<img src=image.png>');
> > >     doc.close();
> > >     return;
> > >   }
> > >
> > >   function frameContents2()
> > >   {
> > >     return "hello";
> > >   }
> > > </script>
> > >
> > > <iframe name="frame1" src="javascript:parent.frameContents1()">
> > > <iframe name="frame2" src="javascript:parent.frameContents2()">
> > > </body>
> > > </html>
> >
> > If there's no manifest="", there's no application cache selected, as far
> > as I can tell.
> 
> Thats what it looks like to me too in the current draft. Wondering if 
> thats the right behavior though?
>
> Generally when loading a frame, the appcache from which the doc resource 
> was loaded gets selected (augmented by an explicit manifest attribute 
> that can make something 'foreign').
>
> In this case, the src is a script embedded in a page that is appcached, 
> so in a transitory sense the doc resource was loaded from an appcache, 
> but that cache does not get selected.

The doc resource was not loaded from the cache, it was loaded from 
evaluating JavaScript.


> Feels like maybe image.png should load from myManifestFile in the 
> sample?

It's trivial for the script to manually include a manifest, if that's what 
the script really wants to do.

I don't think we really want to be encouraging javascript: <iframe>s, 
anyway.

Also, consider this case:

 <iframe src="javascript:parent.frameContents3()+frames['otherWin'].frameContents4()">

...where frames['otherWin'] is from a different manifest. Now what?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Sunday, 19 July 2009 03:10:42 UTC