Commit Graph

235 Commits

Author SHA1 Message Date
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
Nicholas Nethercote
58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Florian Quèze
66f6d259bc Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
Masatoshi Kimura
838ccc4108 Bug 1369025 - Remove mozilla::dom::EncodingUtils. r=hsivonen
MozReview-Commit-ID: 5O5WtxbmATQ

--HG--
rename : dom/encoding/encodingsgroups.properties => intl/locale/encodingsgroups.properties
extra : rebase_source : 13143b43ee745b618e05ed1b6991d69781c2767d
2017-06-17 11:54:40 +09:00
Andrea Marchesini
9e04e35075 Bug 1370819 - Postpone the dispatching of XHR events with opened synchronously, r=smaug 2017-06-16 08:07:00 +02:00
Henri Sivonen
432653453a Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00
Chris H-C
b92d148caa Bug 1367110 - Expose XHRMT's ErrorCode to chrome JS. r=baku
This is presently only relevant for XHRMT, so XHRWorker will just report that
everything's a-ok for now.

As noted inline, the permanence of this measure is to be evaluated in
Firefox 60 in bug 1368540.

MozReview-Commit-ID: 6gkTyZO388g

--HG--
extra : rebase_source : d85ec4181c9bd935f8e419d8d450fd17eb5e1837
2017-05-24 08:52:15 -04:00
Chris H-C
83e4d76955 Bug 1367110 - Make XHRMainThread's mErrorLoad more descriptive. r=baku
There are at least four ways XHRMT can error on load.

Let's be specific about it.

MozReview-Commit-ID: EOml2fcd1XD

--HG--
extra : rebase_source : 7f484f04e2dd6f219911408e7af152f85d4776a9
2017-05-24 08:44:38 -04:00
Sebastian Hengst
08fa09ee69 Backed out changeset 9983ac05d7d1 (bug 1367110) for eslint failures in TelemetrySend.jsm (must use doublequotes). r=backout 2017-05-31 21:02:59 +02:00
Sebastian Hengst
0c1ac2aec4 Backed out changeset 1b93ec532890 (bug 1367110) 2017-05-31 21:02:11 +02:00
Chris H-C
4b7c69cdd1 Bug 1367110 - Expose XHRMT's ErrorCode to chrome JS. r=baku
This is presently only relevant for XHRMT, so XHRWorker will just report that
everything's a-ok for now.

As noted inline, the permanence of this measure is to be evaluated in
Firefox 60 in bug 1368540.

MozReview-Commit-ID: 6gkTyZO388g

--HG--
extra : rebase_source : d85ec4181c9bd935f8e419d8d450fd17eb5e1837
2017-05-24 08:52:15 -04:00
Chris H-C
40857e0ec3 Bug 1367110 - Make XHRMainThread's mErrorLoad more descriptive. r=baku
There are at least four ways XHRMT can error on load.

Let's be specific about it.

MozReview-Commit-ID: EOml2fcd1XD

--HG--
extra : rebase_source : 7f484f04e2dd6f219911408e7af152f85d4776a9
2017-05-24 08:44:38 -04:00
Andrea Marchesini
3d582144b3 Bug 1366595 - Improve the use of strings in XHR logging. r=smaug 2017-05-24 20:27:20 -04:00
Kershaw Chang
383c9e3e60 Bug 1312515 - Part 1: Lower the channel's priority if this XHR is created from tracking script. r=baku
With nsIDocument::IsScriptTracking, we know that whether a script is a tracking script. If the XHR is created by a tracking script, we want to lower the priority of the http channel.

--HG--
extra : rebase_source : 7c9d2a545968a50c8ec34a3395132f0d99087058
2017-05-19 01:28:00 -04:00
Shawn Huang
b96a934bb0 Bug 1365478 - Use BoolVarCache to cache preferences in XMLHttpRequest, r=baku 2017-05-18 19:02:22 +08:00
Shawn Huang
cc72c6e913 Bug 1348390 - Sort and lowercase response's header lists for getAllResponseHeaders(), r=baku
Sort and lowercase response's header lists for getAllResponseHeaders().
Per XHR 4.6.5, make response’s header list sorted and lowercased.
2017-05-17 15:18:46 +08:00
Christoph Kerschbaumer
e4f38c8d7c Bug 1362993 - Rewrite gBrowser.addTab() to use BrowserTestUtils.addTab(). r=florian 2017-05-15 21:49:50 +02:00
Nathan Froyd
c1d1748428 Bug 1359490 - add an event loop spinning abstraction function; r=gerald
This function is arguably nicer than calling NS_ProcessNextEvent
manually, is slightly more efficient, and will enable better auditing
for NS_ProcessNextEvent when we do Quantum DOM scheduling changes.
2017-05-15 09:34:19 -04:00
Shawn Huang
0deb22583d Bug 1362318 - Part2: Fallback override MIME type to application/octet-stream, r=baku
Set override MIME type to 'application/octet-stream', if type is not a parsable
MIME type.
2017-05-11 18:59:10 +08:00
Shawn Huang
c5dd1dadc2 Bug 1362318 - Part1: Use text/xml as fallback response MIME type, r=baku
If response MIME type is the empty byte sequence, then set type to 'text/xml'.
2017-05-11 18:59:00 +08:00
Bevis Tseng
8ad7fc3ed8 Bug 1362944 - Part 2: Set proper event target to MutableBlobStorage when created from XMLHttpRequestMainThread. r=baku
Use the event target provided from XMLHttpRequestMainThread for the runnable dipsatching inside MutableBlobStorage.
2017-05-10 11:45:54 +08:00
Wes Kocher
0070a44b21 Backed out 3 changesets (bug 469228) for being a possible cause of frequent test_animSVGImage.html failures a=backout
Backed out changeset 1431c80b02ef (bug 469228)
Backed out changeset 8d46046a7367 (bug 469228)
Backed out changeset 2e22c0308a7e (bug 469228)

MozReview-Commit-ID: AMRASDPCWu3

--HG--
extra : rebase_source : 46b5ee0f67ffeaec31e1ef379a2e86c20cdee989
2017-05-10 10:13:54 -07:00
Carsten "Tomcat" Book
455239782b Merge mozilla-central to mozilla-inbound 2017-05-10 15:30:44 +02:00
Kershaw Chang
2dd6b7d519 Bug 469228 - Part2: Modify tests that can not pass, r=Waldo 2017-05-10 03:49:00 +02:00
Tom Tung
b1a0b88c98 Bug 1348050 - Part 1: Mark channel as urgent-start when the Fetch and XHR are triggered by user input events. r=baku,mayhemer
Raise the urgent-start flag in the ClassOfService when the Fetch and XHR are
triggered by user input events. The urgent-start classification will tell the
network requests scheduler to perform it with the highest priority and also
ignoring any parallelism or overall connection limits.

MozReview-Commit-ID: 2YavWbuFaln

--HG--
extra : rebase_source : 40f41d1a4b9e323c0cf5710c6d5f2a1e45e93076
2017-04-21 13:29:31 +08:00
Shawn Huang
001b63cc33 Bug 1350787 - DocGroup labeling runnables in dom/xhr, r=baku, f=bevistseng
This patch is to label the runnables dispatched to main thread of the
content process.
The major changes in xhr are to replace DispatchTo{Current,Main}Thread and
replace NS_DispatchToCurrentThread with |mWorkerPrivate->DispatchToMainThread|
in which a DocGroup-specific EventTarget on main thread for worker.
2017-05-09 16:14:51 +08:00
Michael Kaply
4ab68b1150 Bug 1357219 - Don't warn if we can't use a memory mapped file. r=jld
MozReview-Commit-ID: 9ajZCLzQe4G

--HG--
extra : rebase_source : 1a72612fa75724a2836efdd7a712836964a819cf
2017-04-21 15:56:34 -05:00
Tom Tung
8c93a46f2a Bug 1330297 - Part 1: Strip leading or trailing HTTP whitespace for Header value to follow the spec and share code bewteen fetch and XHR. r=baku 2017-04-10 16:15:29 +08:00
Florian Queze
37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Dan Banner
cdf987089d Bug 1107904 - Remove packed.js and references to it as it is unused. r=standard8
MozReview-Commit-ID: K5TLF92pHq4

--HG--
extra : rebase_source : 295bf325a07fa8ec4c55a8babf5418588308dca6
2017-04-12 11:10:00 +01:00