Commit Graph

266 Commits

Author SHA1 Message Date
Nika Layzell
f1ac9bf744 Bug 1419597 - Part 18: Remove IsInnerWindow and IsOuterWindow methods, r=smaug
MozReview-Commit-ID: DAAm6tLubhJ
2017-11-23 13:12:13 -05:00
Andrea Marchesini
73712f7d05 Bug 1405290 - Improve logging of workers when shutting down - part 3 - WorkerHolder with names, r=asuth 2017-11-15 07:58:38 +01:00
Andrea Marchesini
304b80e930 Bug 1413741 - Improve the use of XHR.mProxy in workers after the dispatching of sync OpenRunnable, r=smaug 2017-11-14 08:18:41 +01:00
Andrea Marchesini
209fb327a0 Bug 1411384 - nested sync XHR should throw, r=smaug 2017-11-13 10:17:05 +01:00
Kris Maglione
27c96362b9 Bug 1412345: Downgrade expanded principals before inheriting. r=bz,krizsa
There are several ways that expanded principals can be used as triggering
principals for requests. While that works fine for security checks, it also
sometimes causes them to be inherited, and used as result principals in
contexts where expanded principals aren't allowed.

This patch changes our inheritance behavior so that expanded principals are
downgraded to the most appropriate constituent principal when they would
otherwise be inherited.

The logic for choosing the most appropriate principal is a bit suspect, and
may eventually need to be changed to always select the last whitelist
principal, but I chose it to preserve the current principal downgrade behavior
used by XMLHttpRequest for the time being.

MozReview-Commit-ID: 9fvAKr2e2fa

--HG--
extra : rebase_source : c30df1b3851c11fed5a1d6a7fb158cec14933182
2017-11-02 19:56:27 -07:00
Thomas Wisniewski
34162c2171 Bug 1405696 - pass the document encoding to NS_NewURI for XMLHttpRequest; r=bkelly
MozReview-Commit-ID: IZkWHGZacO0

--HG--
extra : rebase_source : 4cffffd6ce76f49f8515a04cd4f7523e5ceabb1f
2017-10-20 20:47:36 -04:00
Sebastian Hengst
19c5a8852b Backed out changeset 2dd370ac9599 (bug 1405696) for failing web-platform-test /workers/semantics/encodings/003.html. r=backout
--HG--
extra : amend_source : 40342d008230ad926612e852650e3608fc7e44a0
2017-10-20 23:47:38 +02:00
Thomas Wisniewski
0262ef8292 Bug 1405696 - pass the document encoding to NS_NewURI for XMLHttpRequest; r=bkelly
MozReview-Commit-ID: IZkWHGZacO0

--HG--
extra : rebase_source : ac6e2f72fbd0475ba7cbb4ea1231a81d534461fc
2017-10-20 13:49:03 -04:00
Andrea Marchesini
6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Kris Maglione
60d080b412 Bug 1404198: Part 2i - Switch to NS_NewTimer* in dom. r=njn
MozReview-Commit-ID: 8Oei6TuXNbu

--HG--
extra : rebase_source : 31c583c699790cbcf302064146d313ee8126ef0c
2017-10-15 23:15:40 -07:00
Kris Maglione
bd6d63772a Bug 1407428: Hand out a const array reference for expanded principal whiteList. r=krizsa
The current API makes the life time and ownership of the result array unclear
without careful reading. The result array is always owned by the principal,
and its lifetime tied to the lifetime of the principal itself. Returning a
const array reference makes this clear, and should prevent callers from
accidentally modifying the returned array.

MozReview-Commit-ID: 3f8mhynkKAj

--HG--
extra : source : 237acf2879f6222bc4b076c377bf026d18a6ebef
extra : amend_source : dfaf6e88e3c4758f7fdcf7fb422d457edafab1b7
2017-10-10 15:00:16 -07:00
Nicholas Nethercote
f2d1f3b005 Bug 1407117 - Simplify static atom representation. r=froydnj,bz.
Currently nsAtom::mString points to the interior of an nsStringBuffer. For
static atoms this requires the use of nsFakeStringBuffer, which is pretty
gross.

This patch changes things so that nsAtom::mString points to a static char
buffer for static atoms. This simplifies a number of things:

- nsFakeStringBuffer and CheckStaticAtomSizes are no longer needed.

- FakeBufferRefCountHelper is no longer needed.

- nsAtom's constructor for static atoms is simpler.

- RegisterStaticAtoms() is simpler.

On the flip-side, a couple of things get more complicated.

- nsAtom::ToString() treats static and dynamic atoms differently.

- nsAtom::GetStringBuffer() is now only valid for dynamic atoms. This
  function is only used in two places, both involving DOMString, so those
  locations are updated appropriately. This also requires updating some other
  code assigning nsStrings to DOMStrings, because we can't assume that
  nsStrings are shared.

On Linux64 this change reduces the size of the binary by 8752 B, and moves
81968 B from the .data to the .rodata section, where it can be shared between
processes.

--HG--
extra : rebase_source : 0f6fcdec1c525aa66222e208b66a9f9026f69bcb
2017-10-12 10:52:17 +11:00
Sebastian Hengst
11a2b8ef67 Backed out changeset 237acf2879f6 (bug 1407428) for frequent crashes, e.g. in xpcshell's test_bug248970_cookie.js. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 1ccac4fb953566239cba8db7d6f8bdca4ce48b35
2017-10-16 00:00:15 +02:00
Kris Maglione
7d8f8ea3d6 Bug 1407428: Hand out a const array reference for expanded principal whiteList. r=krizsa
The current API makes the life time and ownership of the result array unclear
without careful reading. The result array is always owned by the principal,
and its lifetime tied to the lifetime of the principal itself. Returning a
const array reference makes this clear, and should prevent callers from
accidentally modifying the returned array.

MozReview-Commit-ID: 3f8mhynkKAj

--HG--
extra : rebase_source : d2a5e0862f8c964fb5a3e46b50c2e9629b218699
extra : amend_source : 27d7a7ef5da6fe2aa1104009b6ee067465db73e1
2017-10-10 15:00:16 -07:00
Sebastian Hengst
24f9efc1d1 Backed out changeset 4bac27faa19b (bug 1070763) for crashes and broken websites. r=backout a=backout
MozReview-Commit-ID: 6BAkoAT8JyJ
2017-10-14 23:50:33 +02:00
Sebastian Hengst
776dca65f3 Backed out changeset 224d8c57a469 (bug 1405571) for crashes and broken websites. r=backout a=backout
MozReview-Commit-ID: FZe9hj8nX5w
2017-10-14 23:49:00 +02:00
Thomas Wisniewski
3208e48423 Bug 1405571 - Only do a final flush on the XHR text decoder once; r=hsivonen
MozReview-Commit-ID: 7KphkchHBiw

--HG--
extra : rebase_source : 1125db1e55f5fe579c44d2cb7f259510bba59475
2017-10-04 15:05:28 -04:00
Thomas Wisniewski
5b68608547 Bug 1070763 - Ensure that XHRs sniff the BOM for non-JSON responseTypes, and flush the decoder upon end-of-stream; r=hsivonen
MozReview-Commit-ID: ICHbs2BQcbR

--HG--
extra : rebase_source : 91fac79b191330c5f771386f9977450a569157b1
2017-10-03 08:54:14 -04:00
Thomas Wisniewski
81d59581ae Bug 1341609 - Don't throw on async XHR send() failures when open() created no channel; r=baku
MozReview-Commit-ID: IKVSbdRXoP8

--HG--
extra : rebase_source : 6f85751dae1bf7413598a3ddc381bee86545de9b
2017-09-29 11:36:55 -04:00
Thomas Wisniewski
2956d278f7 Bug 1400748 - Correct our handling of XHR.abort edge-cases; r=baku
1. Handle the "terminate the ongoing fetch" cases in the spec-text
   - do not CloseRequest in Abort/Open if the state is UNSENT or DONE).
   - ensure we don't fire extra events after terminating this way
     if a stray OnDataAvailable happens afterward.
2. Ensure that status/statusText correctly return 0/"" to mimic the
   spec's "set response to a network error" steps (requires special
   handling in the worker XHR code).

MozReview-Commit-ID: 5kMyGgD7uUU

--HG--
extra : rebase_source : ba8b6e85fb922869bbba749b4948bb4489878f22
2017-09-25 12:58:23 -04:00
Chris Peterson
a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Boris Zbarsky
600cbb309f Bug 1401848. Remove NS_IMPL_EVENT_HANDLER and its consumers. r=smaug
All of the objects these event handlers hang off of use webidl bindings now.

MozReview-Commit-ID: 3OdVDlcU67I
2017-09-22 18:07:05 -04:00
Andrea Marchesini
b49b5f31c9 Bug 1397151 - Remove the support for moz-chunk-text type in XHR, r=smaug 2017-09-22 07:18:49 +02:00
Andrea Marchesini
2071ba4680 Bug 1397145 - Remove the support for moz-blob type in XHR, r=smaug 2017-09-22 07:18:14 +02:00
Nicholas Nethercote
e3c9cbb969 Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.

--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
2017-09-22 14:35:46 +10:00
Thomas Wisniewski
e469e3c48d Bug 1392220 - do not parse or return body for XHRs with HEAD or CONNECT method; r=baku
MozReview-Commit-ID: 40CxCiSFdjC

--HG--
extra : rebase_source : 663e09a83dd56aa7b6b76cbd3733cbffda1a7897
2017-09-09 15:34:48 -04:00
Honza Bambas
8d492fe637 Bug 1395525 - Make all changes landed as part of tracker request tailing preferrable. r=dragana 2017-08-31 06:07:00 -04:00
Honza Bambas
4263c50db2 Bug 1358060 - Allow postponing of unimportant resources opening during page load, class-of-service Tail flag. r=dragana
--HG--
extra : rebase_source : 1ab691fe066e641c948aa5f42827305411579708
2017-08-30 09:32:00 -04:00
Andrew McCreight
78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Andrea Marchesini
8aeaa4ff79 Bug 1392358 - Introduce XHR.sendInputStream(nsIInputStream) chrome-only, r=smaug 2017-08-25 15:31:15 +02:00
Andrea Marchesini
a1e210edec Bug 1392358 - Remove XHR.send(nsIInputStream) and unify XHR.send(params) as the spec says, r=smaug 2017-08-25 15:30:33 +02:00
Shawn Huang
cba2d8bb55 Backed out changeset 40b781f6504c (bug 1345457) for breaking xhr test case r=backout 2017-08-21 16:32:00 +08:00
Eric Rahm
9732475fe0 Bug 1389598 - Part 3: Remove gonk references from dom/ r=bkelly
--HG--
extra : rebase_source : 94a2b34b21cfde0c0ebda1045e9d30c6b88a1557
2017-08-11 17:42:11 -07:00
Bobby Holley
d42f0733ac Bug 1389300 - Inherit style backend into NS_NewDOMDocument. r=smaug,r=heycam
Our current machinery for enabling stylo requires a docshell - if there isn't
one, we default to the Gecko style system.

When getComputedStyle operates on an element without a presshell, it uses the
caller's presshell instead. If the element has previously been styled with
one style system (but no longer has a presshell), and the caller uses a
different style backend, using the caller's style system can cause crashes when
we pull bits of cached data off the DOM (like cached style attributes).

So we want to throw when window.getComputedStyle(element) is called for a
(window, element) pair with different style backends (which is what the next
patch in this bug does).

However, that causes a few failures where stylo-backed documents try to do
getComputedStyle on an XHR document (which, without a docshell, will use the
gecko style system).

So this patch does some work to propagate the creator's style backend into
various docshell-less documents. This should allow both chrome (which uses gecko)
and content (which uses stylo) to use getComputedStyle on the response document
for XHRs they create.

Note that the second patch in this bug will make
chromeWin.getComputedStyle(contentObj) throw. If we discover code that does
that, we can just make it invoke the content's getComputedStyle method over Xrays.

MozReview-Commit-ID: 5OsmHJKq5Ui
2017-08-15 19:10:43 -07:00
Masatoshi Kimura
af24452443 Bug 437381 - Remove nsIJSXMLHttpRequest and fix the comments in nsIXMLHttpRequest.h. r=smaug
MozReview-Commit-ID: CYkV01S9QEZ

--HG--
extra : rebase_source : 96e3a42aee2e018e70d54c3bf623e655d85cd32d
2017-08-12 01:16:22 +09:00
Masatoshi Kimura
dec070e4cf Bug 1389460 - Remove @deprecated nsIDOMEventTarget.DispatchDOMEvent. r=smaug
MozReview-Commit-ID: E88DZK5sfwx

--HG--
extra : rebase_source : 64e1a47c9366a970f20ec459dde9b379a207e802
2017-08-07 02:28:52 +09:00
Andrea Marchesini
351d938b86 Bug 1128959 - Implement the WHATWG Streams spec - part 1 - WebIDL Bindings, r=bz 2017-08-10 18:04:54 -07:00
Julian Seward
408d24da56 Bug 1382563 - Remove ns*String::AssignWithConversion. r=erahm.
This patch replaces four functions of the name AssignWithConversion which
are essentially wrappers around CopyASCIItoUTF16 and LossyCopyUTF16toASCII
with direct calls to the latter two functions.  The replaced functions are:

  void nsCString::AssignWithConversion( const nsAString& aData )
  void nsString::AssignWithConversion( const nsACString& aData )

  void nsTString_CharT::AssignWithConversion(
                            const incompatible_char_type* aData,
                            int32_t aLength = -1);

The last of the three exists inside the double-included nsTString* world and
so describes two functions, giving four in total.

This has two advantages:

* it removes code

* at the call points, it makes clear (from the replacement name) which
  conversion is being carried out.  The generic name "AssignWithConversion"
  doesn't make that obvious -- one had to infer it from the types.

The patch also removes two commented out lines from
editor/composer/nsComposerCommands.cpp, that appear to be related.  They are
at top level, where they would never have compiled.  They look like
leftovers from some previous change.

--HG--
extra : rebase_source : fb47bf450771c3c9ee3341dd14520f5da69ec4f5
2017-07-24 19:23:52 +02:00
Sebastian Hengst
93ac0cd0e3 Backed out changeset 6ed95396bdb6 (bug 1362354) for failing web-platform-test /html/browsers/browsing-the-web/navigating-across-documents/010.html. r=backout 2017-07-27 12:48:45 +02:00
Shawn Huang
165f498a83 Bug 1362354 - Send abort event if window.stop() is called, r=baku
Per XHR 4.5.6, end-user abort, it is required to send abort event.
This fixed test XMLHttpRequest/abort-after-stop.htm.
2017-07-27 17:50:13 +08:00
Bevis Tseng
95b18d794e Bug 1382172 - Name nsITimerCallback instances in native implementation. r=billm
--HG--
extra : rebase_source : 84de1abfcc30a6964144c2e6718a508c71027b65
2017-07-27 02:18:20 +08:00
Bevis Tseng
d935b29e72 Bug 1378930 - Part 1: Remove nsINamed::SetName(). r=billm
MozReview-Commit-ID: 7aM1yJRsfPH

--HG--
extra : rebase_source : f207a37be835ac4e6c431af56737cebacf5c566d
2017-07-21 11:50:43 +08:00
Andrea Marchesini
43f7abdf4a Bug 1338339 - dom/xhr/tests/browser_blobFromFile.js must use a separate file for testing instead of prefs.js, r=smaug 2017-07-24 19:58:32 +02:00
Shawn Huang
2a00310982 Bug 1346767 - Part 1: Check mFlagHadUploadListenersOnSend before sending progress event, r=baku
Based on XHR spec 6.1, if one or more event listeners are registered on the
associated XMLHttpRequestUpload object, then set upload listener flag.
Therefore, if any event listeners are added after send(), ignore them.
2017-07-24 19:52:16 +08:00
Sylvestre Ledru
4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Shawn Huang
f0f1e72503 Bug 1345457 - Part 1: Fire up an upload abort event when mFlagHadUploadListenersOnSend is true, r=baku
Fire upload.onabort and upload.onloadend when abort() called. Original code
won't fire onabort if mUploadComplete is true.

Per https://xhr.spec.whatwg.org/#request-error-steps xhr.upload.onabort fires before .onabort
2017-06-30 10:48:25 -07:00
Andrea Marchesini
9214414749 Bug 1377101 - Add some return value checks in XHR, r=mystor 2017-06-29 10:27:59 -07:00
Carsten "Tomcat" Book
4e00eff077 merge mozilla-inbound to mozilla-central a=merge 2017-06-27 10:56:41 +02:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Masatoshi Kimura
b515c9c804 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : fdae0046f882d47fb539a7f882364e5c5caafdcd
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00