Bug 87540 - Allow synchronous XHRs to be disabled in documents
Summary: Allow synchronous XHRs to be disabled in documents
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mihai Parparita
URL:
Keywords:
Depends on: 87783
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-25 15:38 PDT by Mihai Parparita
Modified: 2012-05-29 14:50 PDT (History)
8 users (show)

See Also:


Attachments
Patch (14.20 KB, patch)
2012-05-25 16:19 PDT, Mihai Parparita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Parparita 2012-05-25 15:38:25 PDT
Allow synchronous XHRs to be disabled in documents
Comment 1 Mihai Parparita 2012-05-25 16:19:50 PDT
Created attachment 144166 [details]
Patch
Comment 2 WebKit Review Bot 2012-05-25 16:23:01 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Eric Seidel (no email) 2012-05-25 16:30:22 PDT
Are we disabling them in extensions or something?  I support this change, but I'm curious why we'd have it.
Comment 4 Mihai Parparita 2012-05-25 16:33:44 PDT
(In reply to comment #3)
> Are we disabling them in extensions or something?  I support this change, but I'm curious why we'd have it.

Yeah, for apps. See https://chromiumcodereview.appspot.com/10443047 for the Chromium side that uses this.
Comment 5 Eric Seidel (no email) 2012-05-25 16:37:19 PDT
Comment on attachment 144166 [details]
Patch

LGTM.
Comment 6 Alexey Proskuryakov 2012-05-25 18:08:32 PDT
Comment on attachment 144166 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=144166&action=review

> Source/WebCore/xml/XMLHttpRequest.cpp:489
> +            logConsoleError(scriptExecutionContext(), "Synchronous XMLHttpRequests cannot be made in the current window context.");

Is there a way to explain the reason to authors seeing this? The current wording is a bit misleading (cannot be made in current context, so it can be made in another? what do I do to enable them again?)
Comment 7 Adam Barth 2012-05-25 18:14:48 PDT
Maybe "Synchronous XMLHttpRequests are disabled for this page" ?
Comment 8 WebKit Review Bot 2012-05-25 19:06:06 PDT
Comment on attachment 144166 [details]
Patch

Clearing flags on attachment: 144166

Committed r118599: <http://trac.webkit.org/changeset/118599>
Comment 9 WebKit Review Bot 2012-05-25 19:06:19 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Alexey Proskuryakov 2012-05-29 14:48:12 PDT
This made a lot of tests "flaky" on bots, because the setting leaks from the added test to all future ones:

--- /Volumes/Data/slave/lion-intel-release-tests-wk2/build/layout-test-results/fast/xpath/4XPath/Borrowed/od_20000608-expected.txt
+++ /Volumes/Data/slave/lion-intel-release-tests-wk2/build/layout-test-results/fast/xpath/4XPath/Borrowed/od_20000608-actual.txt
@@ -1,6 +1,6 @@
-PASS nodeset.snapshotLength is 0
-PASS nodeset.snapshotLength is 12
-PASS successfullyParsed is true
+CONSOLE MESSAGE: Synchronous XMLHttpRequests cannot be made in the current window context.
+CONSOLE MESSAGE: line 67: INVALID_ACCESS_ERR: DOM Exception 15: A parameter or an operation was not supported by the underlying object.
+FAIL successfullyParsed should be true (of type boolean). Was undefined (of type undefined).
 
 TEST COMPLETE
Comment 11 Alexey Proskuryakov 2012-05-29 14:50:48 PDT
Filed bug 87783 about that.