[html5] r1724 - /

whatwg at whatwg.org whatwg at whatwg.org
Thu Jun 5 16:41:05 PDT 2008


Author: ianh
Date: 2008-06-05 16:41:05 -0700 (Thu, 05 Jun 2008)
New Revision: 1724

Modified:
   index
   source
Log:
[gow] (2) onbeforeprint and onafterprint

Modified: index
===================================================================
--- index	2008-06-05 11:11:12 UTC (rev 1723)
+++ index	2008-06-05 23:41:05 UTC (rev 1724)
@@ -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>
 
@@ -30130,16 +30132,58 @@
    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.)
+   when invoked, must run the <a href="#printing0">printing steps</a>.
 
-  <h4 id=dialogs><span class=secno>4.5.2 </span>Dialogs implemented using
+  <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
@@ -30283,7 +30327,7 @@
    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

Modified: source
===================================================================
--- source	2008-06-05 11:11:12 UTC (rev 1723)
+++ source	2008-06-05 23:41:05 UTC (rev 1724)
@@ -27870,17 +27870,77 @@
   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>
+
+
+
   <h4>Dialogs implemented using separate documents</h4>
 
   <p>The <dfn title="dom-showModalDialog"><code>showModalDialog(<var




More information about the Commit-Watchers mailing list