<?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>165897</bug_id>
          
          <creation_ts>2016-12-15 05:27:16 -0800</creation_ts>
          <short_desc>XMLHttpRequest timeout in 60 second in Safari on iOS 10 and above</short_desc>
          <delta_ts>2017-01-31 11:08:16 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>Safari 10</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 10</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rahul Tiwari">rahult001</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1260122</commentid>
    <comment_count>0</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2016-12-15 05:27:16 -0800</bug_when>
    <thetext>ajax request time out in 60 second in Safari on iOS 10 and above.
the attached url calls a php script that sleeps 60 seconds. It works fine (display alert window and say &apos;done&apos;) in firefox, and will not work in Safari (blank alert window).

Below is the slightly modified script.
test.php?duration=59 will be fine
test.php?duration=60 will be failed.

test.php
------
  &lt;script src=&quot;javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script&gt;
  var myAjax = new Ajax.Request(
    &apos;http://devel.charmm-gui.org/sleep.php&apos;,
    {
      method: &apos;get&apos;,
      parameters: &apos;duration=&lt;?=$_GET[&apos;duration&apos;]?&gt;&apos;,
      onComplete: showResponse
    });

  function showResponse(oReq) {
    alert(oReq.responseText);
  }
&lt;/script&gt;
----

sleep.php
----
&lt;?
sleep($_GET[&apos;duration&apos;]);
echo &apos;done&apos;;
----</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1260147</commentid>
    <comment_count>1</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-12-15 08:55:14 -0800</bug_when>
    <thetext>Youenn, didn&apos;t we fix this in an iOS update? Or has that not yet shipped?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1260151</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2016-12-15 09:18:40 -0800</bug_when>
    <thetext>It is probably a duplicate of bug 163814 which landed early October.
I don&apos;t know whether that shipped yet though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1260442</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-12-15 18:12:52 -0800</bug_when>
    <thetext>Seems like the fix should have shipped in iOS 10.2 this week. Could you please re-test?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1260450</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-12-15 18:20:07 -0800</bug_when>
    <thetext>There was another related fix just two days ago, which obviously hasn&apos;t shipped yet, see bug 165821.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1260538</commentid>
    <comment_count>5</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2016-12-15 23:10:45 -0800</bug_when>
    <thetext>I had checked it in iOS 10.2(Build 14U593) and it still exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1260619</commentid>
    <comment_count>6</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-12-16 10:25:29 -0800</bug_when>
    <thetext>Could you test to see if https://trac.webkit.org/changeset/209776 fixed your issue?  See https://webkit.org/blog/3457/building-webkit-for-ios-simulator/ for instructions to check Webkit changes on iOS.  It should work with Xcode newer than 6.1.1, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261900</commentid>
    <comment_count>7</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2016-12-20 23:06:30 -0800</bug_when>
    <thetext>I am trying to test if https://trac.webkit.org/changeset/209776 fixed the issue. 
But while building WebKit for iOS Simulator by running - 
Tools/Scripts/build-webkit --ios-simulator
Getting below error - 

Check dependencies
Base.xcconfig line 23: Unable to find included file &quot;../../../../Internal/Configurations/HaveInternalSDK.xcconfig&quot;
Base.xcconfig line 23: Unable to find included file &quot;../../../../Internal/Configurations/HaveInternalSDK.xcconfig&quot;
OS X deployment target &apos;10.11&apos; for architecture &apos;x86_64&apos; and variant &apos;normal&apos; is greater than the maximum value &apos;10.10&apos; for the OS X 10.10 SDK.

Ld /Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release/LayoutTestRelay normal x86_64
    cd /Users/vgarg/AppleWebkit/webkit/Tools/LayoutTestRelay
    export MACOSX_DEPLOYMENT_TARGET=10.11
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release -F/Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release -F/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks -filelist /Users/vgarg/AppleWebkit/webkit/WebKitBuild/LayoutTestRelay.build/Release/LayoutTestRelay.build/Objects-normal/x86_64/LayoutTestRelay.LinkFileList -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks -mmacosx-version-min=10.11 -framework CoreSimulator -framework AppKit -fobjc-arc -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/vgarg/AppleWebkit/webkit/WebKitBuild/LayoutTestRelay.build/Release/LayoutTestRelay.build/Objects-normal/x86_64/LayoutTestRelay_dependency_info.dat -o /Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release/LayoutTestRelay
Undefined symbols for architecture x86_64:
  &quot;_OBJC_CLASS_$_SimServiceContext&quot;, referenced from:
      objc-class-ref in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /Users/vgarg/AppleWebkit/webkit/WebKitBuild/Release/LayoutTestRelay normal x86_64
(1 failure)
Died at Tools/Scripts/build-webkit line 205.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1261903</commentid>
    <comment_count>8</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-12-20 23:13:03 -0800</bug_when>
    <thetext>I&apos;m not terribly familiar with that code, but if you open Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj and play with the #defines in CoreSimulatorSPI.h or main.m.  We should fix this, but it probably won&apos;t cause any problems for you for this purpose to just comment out any code necessary to get it compiling.  You&apos;re not going to use LayoutTestRelay to verify this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263038</commentid>
    <comment_count>9</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2016-12-29 05:10:25 -0800</bug_when>
    <thetext>I tried to comment out #defines in CoreSimulatorSPI.h and tried few other workarounds as well but unfortunately could not get the build successful for command - Tools/Scripts/build-webkit --ios-simulator

I have a limited knowledge of C/Objective C as so far have been mostly working with Java/J2EE related technologies. It would be great if somebody else can verify if https://trac.webkit.org/changeset/209776 fixed the issue or help me over to get this build running.

Also which version of Safari/iOS would be containing the fix(https://trac.webkit.org/changeset/209776) ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263119</commentid>
    <comment_count>10</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-12-29 23:11:15 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; I tried to comment out #defines in CoreSimulatorSPI.h and tried few other
&gt; workarounds as well but unfortunately could not get the build successful for
&gt; command - Tools/Scripts/build-webkit --ios-simulator
&gt; 
&gt; I have a limited knowledge of C/Objective C as so far have been mostly
&gt; working with Java/J2EE related technologies. It would be great if somebody
&gt; else can verify if https://trac.webkit.org/changeset/209776 fixed the issue
&gt; or help me over to get this build running.
&gt; 
&gt; Also which version of Safari/iOS would be containing the
&gt; fix(https://trac.webkit.org/changeset/209776) ?

That fix has shipped in Safari Technology Preview on macOS</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263125</commentid>
    <comment_count>11</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2016-12-30 00:18:48 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; (In reply to comment #9)
&gt; &gt; I tried to comment out #defines in CoreSimulatorSPI.h and tried few other
&gt; &gt; workarounds as well but unfortunately could not get the build successful for
&gt; &gt; command - Tools/Scripts/build-webkit --ios-simulator
&gt; &gt; 
&gt; &gt; I have a limited knowledge of C/Objective C as so far have been mostly
&gt; &gt; working with Java/J2EE related technologies. It would be great if somebody
&gt; &gt; else can verify if https://trac.webkit.org/changeset/209776 fixed the issue
&gt; &gt; or help me over to get this build running.
&gt; &gt; 
&gt; &gt; Also which version of Safari/iOS would be containing the
&gt; &gt; fix(https://trac.webkit.org/changeset/209776) ?
&gt; 
&gt; That fix has shipped in Safari Technology Preview on macOS

Hey Brady
I had raised this issue for Safari on iOS. When will this be shipped on iOS ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263162</commentid>
    <comment_count>12</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-12-30 10:12:58 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #10)
&gt; &gt; (In reply to comment #9)
&gt; &gt; &gt; I tried to comment out #defines in CoreSimulatorSPI.h and tried few other
&gt; &gt; &gt; workarounds as well but unfortunately could not get the build successful for
&gt; &gt; &gt; command - Tools/Scripts/build-webkit --ios-simulator
&gt; &gt; &gt; 
&gt; &gt; &gt; I have a limited knowledge of C/Objective C as so far have been mostly
&gt; &gt; &gt; working with Java/J2EE related technologies. It would be great if somebody
&gt; &gt; &gt; else can verify if https://trac.webkit.org/changeset/209776 fixed the issue
&gt; &gt; &gt; or help me over to get this build running.
&gt; &gt; &gt; 
&gt; &gt; &gt; Also which version of Safari/iOS would be containing the
&gt; &gt; &gt; fix(https://trac.webkit.org/changeset/209776) ?
&gt; &gt; 
&gt; &gt; That fix has shipped in Safari Technology Preview on macOS
&gt; 
&gt; Hey Brady
&gt; I had raised this issue for Safari on iOS. When will this be shipped on iOS ?

With my WebKit hat on, my reply is:
The WebKit open source project is not in charge of future product releases from any particular vendor.

With my Apple hat on, my reply is:
Apple generally doesn&apos;t comment on specific future product releases.

Also with my Apple hat on:
Safari Technology Preview is a glimpse of WebKit changes that Apple plans to ship in future Safari&apos;s on both macOS and iOS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263251</commentid>
    <comment_count>13</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2017-01-01 22:13:10 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; I&apos;m not terribly familiar with that code, but if you open
&gt; Tools/LayoutTestRelay/LayoutTestRelay.xcodeproj and play with the #defines
&gt; in CoreSimulatorSPI.h or main.m.  We should fix this, but it probably won&apos;t
&gt; cause any problems for you for this purpose to just comment out any code
&gt; necessary to get it compiling.  You&apos;re not going to use LayoutTestRelay to
&gt; verify this.

I tried to comment out #defines in CoreSimulatorSPI.h and tried few other workarounds as well but unfortunately could not get the build successful for command - Tools/Scripts/build-webkit --ios-simulator

I have limited knowledge of C/Objective C as so far have been mostly working with Java/J2EE related technologies. It would be great if somebody else can verify if https://trac.webkit.org/changeset/209776 fixed the issue or help me over to get this build running.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1263499</commentid>
    <comment_count>14</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2017-01-03 12:52:37 -0800</bug_when>
    <thetext>Safari Technology Preview only exists on Mac and is not useful for verifying this iOS-specific change that fixed an iOS-specific problem.

To get the build working, comment out this code in Tools/Scripts/build-webkit:
        if (willUseIOSSimulatorSDK()) {
            (system(&quot;perl&quot;, &quot;Tools/Scripts/build-layouttestrelay&quot;, argumentsForConfiguration()) == 0) or die;
        }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1268416</commentid>
    <comment_count>15</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2017-01-20 04:32:08 -0800</bug_when>
    <thetext>As suggested i tried commenting out this code in Tools/Scripts/build-webkit -
        if (willUseIOSSimulatorSDK()) {
            (system(&quot;perl&quot;, &quot;Tools/Scripts/build-layouttestrelay&quot;, argumentsForConfiguration()) == 0) or die;
        }
This got me below error - 
/AppleWebkit1/webkit/Source/WTF/wtf/Platform.h:592:5: error: &apos;TARGET_OS_IOS&apos; is not defined, evaluates to 0 [-Werror,-Wundef]
#if TARGET_OS_IOS

To try to resolve this I added following line to platform.h -
 #define TARGET_OS_IOS 1

This gave below error -
/AppleWebkit1/webkit/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h:162:12: error: cannot find interface declaration for &apos;CASpringAnimation&apos;; did you mean
      &apos;CABasicAnimation&apos;?
@interface CASpringAnimation (Private)
           ^~~~~~~~~~~~~~~~~
           CABasicAnimation

To try to resolve this replaced below line in QuartzCoreSPI.h -
@interface CASpringAnimation (Private) with @interface CABasicAnimation (Private) 

This gave below error -
/AppleWebkit1/webkit/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:60:23: error: property &apos;preferredFramesPerSecond&apos; not found on object of type
      &apos;CADisplayLink *&apos;
        m_displayLink.preferredFramesPerSecond = 60;
                      ^
1 error generated.

Can you please suggest how to resolve the above error and if we are moving in the right direction ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1269068</commentid>
    <comment_count>16</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2017-01-23 09:30:46 -0800</bug_when>
    <thetext>Just comment out the line with preferredFramesPerSecond in it.  I don&apos;t think it&apos;ll critically break anything.  Definitely heading in the right direction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271195</commentid>
    <comment_count>17</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2017-01-29 23:36:41 -0800</bug_when>
    <thetext>(In reply to comment #16)
&gt; Just comment out the line with preferredFramesPerSecond in it.  I don&apos;t
&gt; think it&apos;ll critically break anything.  Definitely heading in the right
&gt; direction.

Moving ahead tried below mentioned steps - 

Error:

/AppleWebkit1/webkit/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:60:23: error: property &apos;preferredFramesPerSecond&apos; not found on object of type
      &apos;CADisplayLink *&apos;
        m_displayLink.preferredFramesPerSecond = 60;

Action Taken:

Commented out preferredFramesPerSecond in the DisplayRefreshMonitorIOS.mm file.

Error:

Users/vgarg/AppleWebkit1/webkit/Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm:40:31: error: use of undeclared identifier &apos;GCControllerPlayerIndex&apos;; did you mean
      &apos;GCControllerPlayerIndexUnset&apos;?
    controller.playerIndex = (GCControllerPlayerIndex)(GCControllerPlayerIndex1 + index);
                              ^~~~~~~~~~~~~~~~~~~~~~~
                              GCControllerPlayerIndexUnset

Action Taken:
Commented out the above line.


Error:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h:74:29: note: 
      &apos;kCGColorSpaceSRGB&apos; has been explicitly marked unavailable here
CG_EXTERN const CFStringRef kCGColorSpaceSRGB
                            ^
/Users/vgarg/AppleWebkit1/webkit/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:112:72: error: use of undeclared identifier &apos;kCGColorSpaceDisplayP3&apos;; did you mean
      &apos;ColorSpaceDisplayP3&apos;?
    static CGColorSpaceRef displayP3Space = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);
                                                                       ^~~~~~~~~~~~~~~~~~~~~~
                                                                       ColorSpaceDisplayP3

Action Taken:

Replaced line “static CGColorSpaceRef displayP3Space = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);” with “static CGColorSpaceRef displayP3Space = displayP3Space;”.

Error:

/Users/vgarg/AppleWebkit1/webkit/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:86:67: error: &apos;kCGColorSpaceSRGB&apos; is unavailable: not available on iOS
    static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);

Action Taken:

Commented out the method content and all the lines which were calling it.


Error:

/Users/vgarg/AppleWebkit1/webkit/Source/WebCore/html/HTMLInputElement.cpp:1985:12: error: no matching constructor for initialization of &apos;WTF::String&apos;
    return String { selectionDirection() };

How should we go about tackling the above error ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271782</commentid>
    <comment_count>18</comment_count>
    <who name="Rahul Tiwari">rahult001</who>
    <bug_when>2017-01-31 10:56:34 -0800</bug_when>
    <thetext>As getting Webkit build running is taking a lot of time for us, can somebody else here test to verify if the fix (https://trac.webkit.org/changeset/209776) resolves the time out of 60 seconds in Safari on iOS 10 and above ?

This will make things faster.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271792</commentid>
    <comment_count>19</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2017-01-31 11:08:16 -0800</bug_when>
    <thetext>I believe the fix should be available in iOS 10.3 public beta 1. Can you try that?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>