couple of preview related queries

classic Classic list List threaded Threaded
3 messages Options
rvj
Reply | Threaded
Open this post in threaded view
|

couple of preview related queries

rvj
I have a couple of preview related queries. I assume this this is the
correct newsgroup?

a) if an iframe is used to display a document which then enters preview mode
the default frame style is over-ridden. In the example below the scrollbars
are suppresssed.

 <iframe id="content"  flex="1"  style="overflow:-moz-scrollbars-none"
type="content-primary" src=".." />

The content is initially displayed without scrollbars but when preview
mode is invoked the scrollbars are restored. Trying to reset the property
doesnt seem to work either.

document.getElementById('content').setAttribute('style',"overflow:-moz-scrol
lbars-none")

b) while either iframe and browser tags both allow a document to be
displayed in  preview mode, any attempt to return   to content mode via the
exitPrintPreview() function
generates a page fault error - this problem doesnt arise when using
tabbrowser.

so does anyone know if iframe and browser can be used instead of tabbrowser
and if so what additional code is is needed?

// *******************************************************************

var state=1
function toggle()
{
         state=state*-1
         if (state<0)
         {
                  previewprint()
         }
         else
         {
                  contentprint()
         }
}
function previewprint()
{
      gWebProgress = new Object();
       var ifreq =
_content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
         var webBrowserPrint =
ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
         gPrintSettings=null
       webBrowserPrint.printPreview(gPrintSettings, null,
gWebProgress.value);
}


function contentprint()
{
  // exit print preview galley mode in content area
  var ifreq = _content.QueryInterface(
Components.interfaces.nsIInterfaceRequestor);
  var webBrowserPrint = ifreq.getInterface(
Components.interfaces.nsIWebBrowserPrint);
  webBrowserPrint.exitPrintPreview();  // page fault
}
  ]]>
</script>

<control id="toggle"  onclick="toggle()"
style="height:200px;background:red"/>
<iframe type="content-primary" flex="1" src="........"/>









_______________________________________________
mozilla-layout mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-layout
rvj
Reply | Threaded
Open this post in threaded view
|

Re: couple of preview related queries

rvj

please ignore second part of query as it seems I need to convert chrome:
URLs to file: URLs to avoid the page fault.


"rvj" <[hidden email]> wrote in message
news:dkf7ch$[hidden email]...
> I have a couple of preview related queries. I assume this this is the
> correct newsgroup?
>
> a) if an iframe is used to display a document which then enters preview
mode
> the default frame style is over-ridden. In the example below the
scrollbars

> are suppresssed.
>
>  <iframe id="content"  flex="1"  style="overflow:-moz-scrollbars-none"
> type="content-primary" src=".." />
>
> The content is initially displayed without scrollbars but when preview
> mode is invoked the scrollbars are restored. Trying to reset the property
> doesnt seem to work either.
>
>
document.getElementById('content').setAttribute('style',"overflow:-moz-scrol
> lbars-none")
>
> b) while either iframe and browser tags both allow a document to be
> displayed in  preview mode, any attempt to return   to content mode via
the
> exitPrintPreview() function
> generates a page fault error - this problem doesnt arise when using
> tabbrowser.
>
> so does anyone know if iframe and browser can be used instead of
tabbrowser

> and if so what additional code is is needed?
>
> // *******************************************************************
>
> var state=1
> function toggle()
> {
>          state=state*-1
>          if (state<0)
>          {
>                   previewprint()
>          }
>          else
>          {
>                   contentprint()
>          }
> }
> function previewprint()
> {
>       gWebProgress = new Object();
>        var ifreq =
> _content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
>          var webBrowserPrint =
> ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);
>          gPrintSettings=null
>        webBrowserPrint.printPreview(gPrintSettings, null,
> gWebProgress.value);
> }
>
>
> function contentprint()
> {
>   // exit print preview galley mode in content area
>   var ifreq = _content.QueryInterface(
> Components.interfaces.nsIInterfaceRequestor);
>   var webBrowserPrint = ifreq.getInterface(
> Components.interfaces.nsIWebBrowserPrint);
>   webBrowserPrint.exitPrintPreview();  // page fault
> }
>   ]]>
> </script>
>
> <control id="toggle"  onclick="toggle()"
> style="height:200px;background:red"/>
> <iframe type="content-primary" flex="1" src="........"/>
>
>
>
>
>
>
>
>
>


_______________________________________________
mozilla-layout mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-layout
Reply | Threaded
Open this post in threaded view
|

Re: couple of preview related queries

Robert O'Callahan-2
In reply to this post by rvj
For issue a), you should probably file a bug. But try using
overflow:hidden first...

_______________________________________________
mozilla-layout mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-layout