Skip to content
Permalink
Browse files

[gow] (2) onbeforeprint and onafterprint

git-svn-id: http://svn.whatwg.org/webapps@1724 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 5, 2008
1 parent fcb6a7b commit fb171984d2434adcf2bed6df90fc9ba7ca4515c3
Showing with 123 additions and 19 deletions.
  1. +56 −12 index
  2. +67 −7 source
68 index
@@ -1106,10 +1106,12 @@
<li><a href="#simple0"><span class=secno>4.5.1 </span>Simple
dialogs</a>

<li><a href="#dialogs"><span class=secno>4.5.2 </span>Dialogs
<li><a href="#printing"><span class=secno>4.5.2 </span>Printing</a>

<li><a href="#dialogs"><span class=secno>4.5.3 </span>Dialogs
implemented using separate documents</a>

<li><a href="#notifications"><span class=secno>4.5.3
<li><a href="#notifications"><span class=secno>4.5.4
</span>Notifications</a>
</ul>

aborts, then the method must return null; otherwise, the method must
return the string that the user responded with.

<h4 id=printing><span class=secno>4.5.2 </span>Printing</h4>

<p>The <dfn id=print title=dom-print><code>print()</code></dfn> method,
when invoked, should offer the user the opportunity to <a
href="#obtain">obtain a physical form</a> of the document. The user agent
may make the method wait for the user to either accept or decline before
returning; if so, the user agent must <a href="#pause">pause</a> while the
method is waiting. (This does not, of course, preclude the user agent from
<em>always</em> offering the user with the opportunity to convert the
document to whatever media the user might want.)

<h4 id=dialogs><span class=secno>4.5.2 </span>Dialogs implemented using
when invoked, must run the <a href="#printing0">printing steps</a>.

<p>User agents should also run the <a href="#printing0">printing steps</a>
whenever the user attempts to obtain a physical form (e.g. printed copy),
or the representation of a physical form (e.g. PDF copy), of a document.

<p>The <dfn id=printing0>printing steps</dfn> are as follows:

<ol>
<li>
<p>The user agent may display a message to the user and/or may abort
these steps.</p>

<p class=example>For instance, a kiosk browser could silently ignore any
invocations of the <code title=dom-print><a
href="#print">print()</a></code> method.</p>

<p class=example>For instance, a browser on a mobile device could detect
that there are no printers in the vicinity and display a message saying
so before continuing to offer a "save to PDF" option.</p>

<li>
<p>The user agent must <a href="#firing2">fire a simple event</a> called
<code title=event-onbeforeprint>onbeforeprint</code> at the <code><a
href="#window">Window</a></code> object of the browsing context of the
<code>Document</code> that is being printed, as well as any <a
href="#nested0" title="nested browsing context">nested browsing
contexts</a> in it.</p>

<li>
<p>The user agent should offer the user the opportunity to <a
href="#obtain">obtain a physical form</a> (or the representation of a
physical form) of the document. The user agent may wait for the user to
either accept or decline before returning; if so, the user agent must <a
href="#pause">pause</a> while the method is waiting. Even if the user
agent doesn't wait at this point, the user agent must use the state of
the relevant documents as they are at this point in the algorithm if and
when it eventually creates the alternate form.</p>

<li>
<p>The user agent must <a href="#firing2">fire a simple event</a> called
<code title=event-onafterprint>onafterprint</code> at the <code><a
href="#window">Window</a></code> object of the browsing context of the
<code>Document</code> that is being printed, as well as any <a
href="#nested0" title="nested browsing context">nested browsing
contexts</a> in it.</p>
</ol>

<h4 id=dialogs><span class=secno>4.5.3 </span>Dialogs implemented using
separate documents</h4>

<p>The <dfn id=showmodaldialog
of its browsing context, and on setting, must set the <a
href="#return">return value</a> to the given new value.

<h4 id=notifications><span class=secno>4.5.3 </span>Notifications</h4>
<h4 id=notifications><span class=secno>4.5.4 </span>Notifications</h4>
<!-- v2 feature requests:

- ability to snooze a notification so it comes again later
74 source
user aborts, then the method must return null; otherwise, the method
must return the string that the user responded with.</p>


<h4>Printing</h4>

<p>The <dfn title="dom-print"><code>print()</code></dfn> method,
when invoked, should offer the user the opportunity to <span>obtain
a physical form</span> of the document. The user agent may make the
method wait for the user to either accept or decline before
returning; if so, the user agent must <span>pause</span> while the
method is waiting. (This does not, of course, preclude the user
agent from <em>always</em> offering the user with the opportunity to
convert the document to whatever media the user might want.)</p>
when invoked, must run the <span>printing steps</span>.</p>

<p>User agents should also run the <span>printing steps</span>
whenever the user attempts to obtain a physical form (e.g. printed
copy), or the representation of a physical form (e.g. PDF copy), of
a document.</p>

<p>The <dfn>printing steps</dfn> are as follows:</p>

<ol>

<li>

<p>The user agent may display a message to the user and/or may
abort these steps.</p>

<p class="example">For instance, a kiosk browser could silently
ignore any invocations of the <code
title="dom-print">print()</code> method.</p>

<p class="example">For instance, a browser on a mobile device
could detect that there are no printers in the vicinity and
display a message saying so before continuing to offer a "save to
PDF" option.</p>

</li>

<li>

<p>The user agent must <span>fire a simple event</span> called
<code title="event-onbeforeprint">onbeforeprint</code> at the
<code>Window</code> object of the browsing context of the
<code>Document</code> that is being printed, as well as any <span
title="nested browsing context">nested browsing contexts</span> in
it.</p>

</li>

<li>

<p>The user agent should offer the user the opportunity to
<span>obtain a physical form</span> (or the representation of a
physical form) of the document. The user agent may wait for the
user to either accept or decline before returning; if so, the user
agent must <span>pause</span> while the method is waiting. Even if
the user agent doesn't wait at this point, the user agent must use
the state of the relevant documents as they are at this point in
the algorithm if and when it eventually creates the alternate
form.</p>

</li>

<li>

<p>The user agent must <span>fire a simple event</span> called
<code title="event-onafterprint">onafterprint</code> at the
<code>Window</code> object of the browsing context of the
<code>Document</code> that is being printed, as well as any <span
title="nested browsing context">nested browsing contexts</span> in
it.</p>

</li>

</ol>



0 comments on commit fb17198

Please sign in to comment.
You can’t perform that action at this time.