<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>136335</bug_id>
          
          <creation_ts>2014-08-28 03:09:48 -0700</creation_ts>
          <short_desc>window.print() is blocked until XMLHttpRequest completes</short_desc>
          <delta_ts>2017-10-17 12:25:46 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Printing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.9</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrew Paprotsky">andrew</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>hello</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>steipete</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1031949</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Paprotsky">andrew</who>
    <bug_when>2014-08-28 03:09:48 -0700</bug_when>
    <thetext>If there&apos;s an active XMLHttpRequest window.print() is blocked; print dialog appears only when the request is completed. This is a problem for cases when XMLHttpRequest is used for long-polling.

Steps to reproduce:
1. Extract the attached archive to a PHP enabled web server
2. Visit the index.php.
3. Click the button to see the result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1031950</commentid>
    <comment_count>1</comment_count>
      <attachid>237302</attachid>
    <who name="Andrew Paprotsky">andrew</who>
    <bug_when>2014-08-28 03:11:03 -0700</bug_when>
    <thetext>Created attachment 237302
reproducible test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1032060</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2014-08-28 13:19:15 -0700</bug_when>
    <thetext>Thank you for the bug report.

I think that this is unintentional (and a consequence of delaying a print() that&apos;s called from an inline script), yet this still looks like a correct behavior.

If XHR progress events were displayed under a modal print dialog, that would cause many undesirable effects (e.g. what if event handler tried to do a window.close() while the window was being printed). And if we stopped progress events, that would cause correctness issues on websites that expect them to be handled in a timely manner.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1032119</commentid>
    <comment_count>3</comment_count>
    <who name="Andrew Paprotsky">andrew</who>
    <bug_when>2014-08-28 23:04:20 -0700</bug_when>
    <thetext>Thanks for the quick reply.

The problem is that if I want to print something using window.print() then I have to wait until active XHR is completed. So if I have a long-polling request with 10 minutes timeout then in worst case I&apos;d have to wait 10 minutes until the print dialog appears.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1360798</commentid>
    <comment_count>4</comment_count>
    <who name="Philipp Spiess">hello</who>
    <bug_when>2017-10-16 09:51:02 -0700</bug_when>
    <thetext>This is still an issue. Chrome seems to have fixed this [1], are there any plans for Safari to do the same as well?

This makes it impossible to use the print API for websites that rely on long-polling to get real time updates.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=173140</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1361360</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-10-17 12:25:46 -0700</bug_when>
    <thetext>&lt;rdar://problem/35035119&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>237302</attachid>
            <date>2014-08-28 03:11:03 -0700</date>
            <delta_ts>2014-08-28 03:11:03 -0700</delta_ts>
            <desc>reproducible test case</desc>
            <filename>webkit.zip</filename>
            <type>application/zip</type>
            <size>807</size>
            <attacher name="Andrew Paprotsky">andrew</attacher>
            
              <data encoding="base64">UEsDBAoAAAAAAAppHEUAAAAAAAAAAAAAAAAHABAAd2Via2l0L1VYDACU//5TlP/+U/UBFABQSwME
FAAIAAgAgGMcRQAAAAAAAAAAAAAAABAAEAB3ZWJraXQvaW5kZXgucGhwVVgMAJ7//lMf9v5T9QEU
AGVRPU/DMBCd219x8pJEQjEgtibZKjrAUhiyGucqh6a2OV9KK8R/x61LEODF0vP7lCvDu6GZVwZV
18whnipo6j0DHz3WgvHA8lXtVUJF4sw2o9XcOwvaWYuaW0NPTKh2eQEfiTLbK4KDIajB4ju0jw8r
Zr/GtxED58XiwoqM0nm0eXa/fM6uIItAOFuV3vgIMI34ix3QdpP+M3WWqV4cItOS6sV1x9M1Msea
4Kweer2txf/CC9HATQmeMAQwSAjsvndBu1pDqgP5oALDxhHcXYeiksn6lEE/QVOOp97GmaK5/Wt9
fpnkSS0vdWX6ji9QSwcIIJ5Dz+4AAACWAQAAUEsDBBQACAAIAJZhHEUAAAAAAAAAAAAAAAAUABAA
d2Via2l0L3hocnN0cmVhbS5waHBVWAwAnv/+U4vy/lP1ARQAs7HnUilWsFVQMjA0MjYxNTO3sBxl
jbJGWcOVpWTNlZZfpKGSCcz0BtYKQNpGwQjM0NbWVKjmUgCCgqLMvJI0DSXVipiimDzVYhCppKNQ
XFKUk5qnoVKsqaMAJKzBatNySoszNKCc4pzU1AINIyCvlsvejgsAUEsHCCfsf/t1AAAAXQQAAFBL
AQIVAwoAAAAAAAppHEUAAAAAAAAAAAAAAAAHAAwAAAAAAAAAAEDtQQAAAAB3ZWJraXQvVVgIAJT/
/lOU//5TUEsBAhUDFAAIAAgAgGMcRSCeQ8/uAAAAlgEAABAADAAAAAAAAAAAQKSBNQAAAHdlYmtp
dC9pbmRleC5waHBVWAgAnv/+Ux/2/lNQSwECFQMUAAgACACWYRxFJ+x/+3UAAABdBAAAFAAMAAAA
AAAAAABApIFxAQAAd2Via2l0L3hocnN0cmVhbS5waHBVWAgAnv/+U4vy/lNQSwUGAAAAAAMAAwDZ
AAAAOAIAAAAA
</data>

          </attachment>
      

    </bug>

</bugzilla>