Skip to content

Commit

Permalink
[gow] (2) onbeforeprint and onafterprint
Browse files Browse the repository at this point in the history
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 fb17198
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 19 deletions.
68 changes: 56 additions & 12 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -30130,16 +30132,58 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
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
Expand Down Expand Up @@ -30283,7 +30327,7 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
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
Expand Down
74 changes: 67 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -27870,14 +27870,74 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
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>



Expand Down

0 comments on commit fb17198

Please sign in to comment.