Commit Graph

5344 Commits

Author SHA1 Message Date
Kris Maglione
3a5c05e76f Bug 1484496: Part 5e - Convert remaining nsISimpleEnumerator users to use JS iteration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D3733

--HG--
extra : rebase_source : c0fac176d7b3d840c4dbb14f8d95ccfc7f83a5a8
extra : histedit_source : a92c40117d0808a3ad68c972f622a7a42c9ae8ba
2018-08-18 18:13:14 -07:00
Kris Maglione
2dee0aae3c Bug 1484496: Part 4b - Add intrinsic type information to most nsSimpleEnumerators. r=froydnj
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.

Differential Revision: https://phabricator.services.mozilla.com/D3728

--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
2018-08-18 21:06:32 -07:00
Kris Maglione
65c28aa0ad Bug 1484496: Part 2 - Add common base class for all nsISimpleEnumerator implementations. r=froydnj
In order to allow JS callers to use nsISimpleEnumerator instances with the JS
iteration protocol, we'll need to additional methods to every instance. Since
we currently have a large number of unrelated implementations, it would be
best if they could share the same implementation for the JS portion of the
protocol.

This patch adds a stub nsSimpleEnumerator base class, and updates all existing
implementations to inherit from it. A follow-up will add a new base interface
to this class, and implement the additional functionality required for JS
iteration.

Differential Revision: https://phabricator.services.mozilla.com/D3725

--HG--
extra : rebase_source : ad66d7b266856d5a750c772e4710679fab9434b1
extra : histedit_source : a83ebffbf2f0b191ba7de9007f73def6b9a955b8
2018-08-18 14:22:47 -07:00
Nicholas Nethercote
8cb0711355 Bug 1485279 - Merge nsISHContainer into nsISHEntry. r=qdot
nsSHEntry is the only class that instantiates those two interfaces, so the
separation is not useful. This lets us remove numerous pointless QIs.

--HG--
extra : rebase_source : 570b7ade669fb89a789184198bec9da186c5f1d3
2018-08-22 19:20:56 +10:00
Nicholas Nethercote
d596237589 Bug 1485279 - Merge nsISHEntryInternal into nsISHEntry. r=qdot
nsSHEntry is the only class that instantiates those two interfaces, so the
separation is not useful. This lets us remove several pointless QIs.

The patch also removes RemoveFromBFCache{AS,S}ync, which are unused.

--HG--
extra : rebase_source : 84db7ec180c357ab8c762dc60efb5eed444ba514
2018-08-22 19:13:57 +10:00
James Willcox
89e3bb5c75 Bug 1480095 - Allow loading custom error pages via nsILoadURIDelegate r=esawin,bz,jchen
MozReview-Commit-ID: IhVC9nU60fy
2018-08-22 08:46:41 -05:00
Nicholas Nethercote
5ad84b56e2 Bug 1484944 - Remove nsSHEnumerator. r=qdot
--HG--
extra : rebase_source : 3f52fd7bf780e53631919a0f2e6925345b714517
2018-08-21 19:52:19 +10:00
Eliza Balazs
e0f5c50037 Bug 1423959 - Disable browser_loadURI.js on linux and osx. r=jmaher 2018-08-17 05:53:00 -04:00
Kris Maglione
f84c2cf454 Bug 1480244: Part 1c - Rename TabChildGlobal to TabChildMessageManager. r=bz
MozReview-Commit-ID: ECtFjFV7dZa

--HG--
extra : rebase_source : 50e64fa4da1099ca2bd9e14c8679bb87c354015e
2018-08-10 14:04:23 -07:00
Henri Sivonen
3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
Margareta Eliza Balazs
e53d398574 Merge inbound to mozilla-central. a=merge 2018-08-14 12:30:50 +03:00
Francois Marier
71239f0c25 Bug 1480450 - Honor browser.contentblocking.enabled in tracking protection. r=dimi!
Depends on D3131

Differential Revision: https://phabricator.services.mozilla.com/D3132

--HG--
extra : moz-landing-system : lando
2018-08-13 23:20:40 +00:00
Ciure Andrei
057ea5d560 Backed out 1 changesets (bug 1480450) for mochitest/test_trackingprotection_bug1157081.html failures CLOSED TREE
Backed out changeset 34d3b10c54eb (bug 1480450)
2018-08-13 22:45:37 +03:00
Francois Marier
47ba3463cd Bug 1480450 - Honor browser.contentblocking.enabled in tracking protection. r=dimi!
Depends on D3131

Differential Revision: https://phabricator.services.mozilla.com/D3132

--HG--
extra : moz-landing-system : lando
2018-08-13 14:54:10 +00:00
Ting-Yu Lin
48d02834a5 Bug 1482665 Part 2 - Remove nsPresContext::AppUnitsPerCSSPixel() and replace it with mozilla::AppUnitsPerCSSPixel(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D3155
2018-08-13 14:29:28 -07:00
Gabriele Svelto
15adf94f4d Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.

--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 15:42:11 +02:00
Jonathan Kingston
9b7fb2f20c Bug 1362034 - Have addTab() provide the correct triggering principal. r=ckerschb r=Gijs
Reviewers: ckerschb!, Gijs!

Tags: #secure-revision

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2046

--HG--
extra : source : 44b25dea67d2ed079e17057ab619d827e9983400
extra : amend_source : 5742820277e0269b6f5d42b1abd98fd9b228ac4a
extra : histedit_source : 790bd2490333e4d8fea7774d036eafbc2fc329b9
2018-07-06 15:14:54 +01:00
Jonathan Kingston
2f0987a202 Bug 1362034 - Tests for addTab() to provide the correct triggering principal. r=ckerschb r?=gijs
Summary: Depends on D2046

Reviewers: ckerschb!, Gijs!

Tags: #secure-revision

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2047

--HG--
extra : source : 33884d05cc94463950b31fab1fd2f37ada9becef
extra : intermediate-source : 72471adb75d5ec3dc2b0c8f972a6f1f26bfd3ae2
extra : histedit_source : f384cbab58401575afc3443c9a431b73cff806d4
2018-07-06 21:16:29 +01:00
dvarga
12f19b94e9 Backed out 2 changesets (bug 1362034) for failure at browser/tools/mozscreenshots/primaryUI/browser_primaryUI.js on a CLOSED TREE
Backed out changeset 1c3329958b8a (bug 1362034)
Backed out changeset f68b1b76af36 (bug 1362034)

--HG--
extra : histedit_source : 6169c5ffe856266d3bc8b2ca32f4b67054c71bbe
2018-08-08 22:11:56 +03:00
Jonathan Kingston
c15f69d427 Bug 1362034 - Tests for addTab() to provide the correct triggering principal. r=ckerschb,Gijs
Summary: Depends on D2046

Reviewers: ckerschb, Gijs

Reviewed By: ckerschb, Gijs

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2047

--HG--
extra : rebase_source : ccded0f06a0dc4567b827f42ee29f4b8954154fe
extra : amend_source : 94da8ecc053e56958fa4137d7e497362fa2c11f1
2018-08-08 20:05:30 +03:00
Jonathan Kingston
f389570122 Bug 1362034 - Have addTab() provide the correct triggering principal. r=ckerschb,Gijs
Reviewers: ckerschb, Gijs

Reviewed By: ckerschb, Gijs

Subscribers: mixedpuppy, reviewbot

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2046

--HG--
extra : rebase_source : ea688b35744f970e74de3039da3973f1177d8577
extra : amend_source : 89efdb8ccec2c334a83155eec6b30f08fa0f7074
2018-08-08 20:03:55 +03:00
Kris Maglione
773d32e9fe Bug 1481021: Part 2 - Stop loading SpecialPowers into frame script scopes. r=bz,jmaher,aswan
Loading SpecialPowers into frame scripts has side-effects, detailed in part 1,
which are undesirable. The main side-effect that I'm trying to get rid of here
is the force-enabling of permissive COWs in frame script scopes, which is
blocking changes that I need to make elsewhere. But both that and the scope
pollution it causes are likely to allow code to work when running in
automation which fails in real world usage.

This patch changes our special powers frame scripts to load specialpowers.js
and specialpowersAPI.js as JSMs, which run in their own global, but define
most of the same properties on our frame script globals.

Most other callers still load those scripts via <script> tags or the subscript
loader, and should ideally migrated in a follow-up. But even so, this patch
still gives us a cleaner separation of the frame script and non-frame-script
loading code.

MozReview-Commit-ID: CR226gCDaGY

--HG--
extra : rebase_source : 251574d238ded31b9df32dc89852251831d55757
extra : source : c53c7b0249ad3359fbc9f144f2cf9ca3b6386c59
2018-08-07 14:03:21 -07:00
Kyle Machulis
3b913b0f12 Bug 1480641 - Remove nsITextScroll; r=nika
Summary:
Implemented by nsDocShell and nsWebBrowser (which just wraps the
docshell functions), but not actually used anywhere.

MozReview-Commit-ID: 2YzfsrvOolX

Test Plan: Try run

Reviewers: nika

Tags: #secure-revision

Bug #: 1480641

Differential Revision: https://phabricator.services.mozilla.com/D2695
2018-08-07 17:28:16 -07:00
Brindusan Cristian
16ec846afc Backed out 2 changesets (bug 1481021) for bc failures on security/sandbox/test/browser_bug1393259.js.
Backed out changeset c53c7b0249ad (bug 1481021)
Backed out changeset 41bedc526dd6 (bug 1481021)
2018-08-08 03:22:16 +03:00
Kyle Machulis
ee7197155b Bug 1480637 - Remove nsIClipboardCommands; r=nika
Summary:
Unused interface that can be removed.

MozReview-Commit-ID: GnHRXdtI4qe

Test Plan: Try run

Reviewers: nika

Tags: #secure-revision

Bug #: 1480637

Differential Revision: https://phabricator.services.mozilla.com/D2694
2018-08-07 15:12:55 -07:00
Kyle Machulis
d920d54421 Bug 1480628 - Remove nsIWebShellServices; r=nika
Summary:
nsIWebShellServices is only implemented by nsDocShell, and only used
in one place in C++. Move definitions to nsIDocShell, and rename
functions to show they are only used as part of Charset changes.

MozReview-Commit-ID: DOSeE3Doc51

Test Plan: Try run

Reviewers: nika

Tags: #secure-revision

Bug #: 1480628

Differential Revision: https://phabricator.services.mozilla.com/D2692
2018-08-07 15:12:55 -07:00
Kris Maglione
b9e9588050 Bug 1481021: Part 2 - Stop loading SpecialPowers into frame script scopes. r=bz,jmaher,aswan
Loading SpecialPowers into frame scripts has side-effects, detailed in part 1,
which are undesirable. The main side-effect that I'm trying to get rid of here
is the force-enabling of permissive COWs in frame script scopes, which is
blocking changes that I need to make elsewhere. But both that and the scope
pollution it causes are likely to allow code to work when running in
automation which fails in real world usage.

This patch changes our special powers frame scripts to load specialpowers.js
and specialpowersAPI.js as JSMs, which run in their own global, but define
most of the same properties on our frame script globals.

Most other callers still load those scripts via <script> tags or the subscript
loader, and should ideally migrated in a follow-up. But even so, this patch
still gives us a cleaner separation of the frame script and non-frame-script
loading code.

MozReview-Commit-ID: CR226gCDaGY

--HG--
extra : rebase_source : fa253abde2029ec09c724404106d83623f064875
2018-08-07 14:03:21 -07:00
Dylan Roeh
63ca464a8c Bug 1441059 - Make nsILoadURIDelegate async to preserve the order of GeckoSession.loadUri() calls. r=snorp,bz
This alters nsILoadURIDelegate.loadURI() to return a Promise rather than spinning the event loop to synchronously return a boolean, and alters nsDocShell::InternalLoad to allow for those changes by re-calling itself if necessary based on the resolution of the promise.
2018-08-07 13:42:07 -05:00
Andreea Pavel
f5c1119983 Backed out 2 changesets (bug 1362034) for failing damp | inspector/cold-open.js on a CLOSED TREE
Backed out changeset 8c8925b75aa2 (bug 1362034)
Backed out changeset ff6b05c96094 (bug 1362034)
2018-08-06 20:42:44 +03:00
Jonathan Kingston
4ca581ffed Bug 1362034 - Tests for addTab() to provide the correct triggering principal. r=ckerschb,Gijs
Summary: Depends on D2046

Reviewers: ckerschb, Gijs

Reviewed By: ckerschb, Gijs

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2047

--HG--
extra : rebase_source : 4bb9e7feb0704239756e6e38623c0fea81669f7b
extra : amend_source : 9417f96547735fbdc55ea23666327a5cb86ac92f
2018-08-06 19:56:37 +03:00
Jonathan Kingston
9be2ebdb53 Bug 1362034 - Have addTab() provide the correct triggering principal. r=ckerschb,Gijs
Reviewers: ckerschb, Gijs

Reviewed By: ckerschb, Gijs

Subscribers: reviewbot

Bug #: 1362034

Differential Revision: https://phabricator.services.mozilla.com/D2046

--HG--
extra : rebase_source : 57c6bda461781ec20f0ceba8d1dd9c48778bf568
extra : amend_source : 2eebbf1e7df91697ce984d2845dbae41f9dcbcbd
2018-08-06 19:54:47 +03:00
Noemi Erli
23c8a3a9f3 Backed out changeset 1e9ecba54e7b (bug 1348273) for failing on widget/tests/test_bug1123480.xul 2018-08-04 12:39:40 +03:00
Gabriele Svelto
50ba13cce4 Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant functions are updated to take a typed enum (in C++) and an
integer constant (in JavaScript). A JavaScript wrapper around the crash
reporter service is provided to hold the constants. The existing whitelists
and blacklists of annotations are also generated from the YAML file and the
existing duplicate code has been consolidated. Once written out to the .extra
file the annotations are converted in string form and are no different than
the existing ones.

All existing annotations have been included (and some obsolete ones removed)
and all call sites have been updated including tests.

--HG--
extra : rebase_source : b4f0d4bf83c64851028c271d3fab3ebcb6fbcd3e
2018-07-05 15:42:11 +02:00
Coroiu Cristina
1ba19a32ac Backed out changeset 86471a18672f (bug 1348273) for ESlint failure at toolkit/modules/WebNavigationChild.jsm
--HG--
extra : rebase_source : e0c94f49ddc1f1b119b72c06fccc1b4363b9d340
2018-08-03 22:48:51 +03:00
Gabriele Svelto
eff24befbd Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant functions are updated to take a typed enum (in C++) and an
integer constant (in JavaScript). A JavaScript wrapper around the crash
reporter service is provided to hold the constants. The existing whitelists
and blacklists of annotations are also generated from the YAML file and the
existing duplicate code has been consolidated. Once written out to the .extra
file the annotations are converted in string form and are no different than
the existing ones.

All existing annotations have been included (and some obsolete ones removed)
and all call sites have been updated including tests.

--HG--
extra : rebase_source : f0e8d229581ac5c0daa0e0454cb258746108e28d
2018-07-05 15:42:11 +02:00
Boris Zbarsky
e2aafee76f Bug 1479569 part 3. Remove nsIContentFrameMessageManager. r=kmag 2018-08-02 23:49:09 -04:00
Boris Zbarsky
b421d6d7fb Bug 1479569 part 1. Add a ContentFrameMessageManager getter on nsIDocShell. r=kmag 2018-08-02 23:49:09 -04:00
Boris Zbarsky
357b6b1348 Bug 1479570. Get Add a getter to get a docshell from nsIWindowlessBrowser. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D2669

--HG--
extra : moz-landing-system : lando
2018-08-03 00:05:07 +00:00
Boris Zbarsky
30718f15fe Bug 1480310. Use docshell's editingSession getter instead of getInterface to get editing sessions. r=kmag
All the C++ consumers already call the getter, so we can remove
nsIEditingSession from the docshell GetInterface method completely.

Differential Revision: https://phabricator.services.mozilla.com/D2668

--HG--
extra : moz-landing-system : lando
2018-08-02 19:15:27 +00:00
Noemi Erli
8f66a71e70 Merge inbound to mozilla-central. a=merge 2018-08-02 11:54:46 +03:00
Kyle Machulis
e8ad4d6c8a Bug 1450164 - Don't update URIs on history adds on docshells that are being shut down; r=bzbarsky
If we add to history on a docshell that is being shut down, add
history entry but skip trying to load the new URI.

MozReview-Commit-ID: JCF9muhxbFd

Differential Revision: https://phabricator.services.mozilla.com/D2311

--HG--
extra : moz-landing-system : lando
2018-08-02 00:51:09 +00:00
Xidorn Quan
8421040c69 Bug 1479995 - Rename ScrollbarStyles to ScrollStyles. r=mstange
This change also renames several related functions, as well as fields,
and the header is moved into EXPORTS.mozilla given it is defined under
mozilla namespace.

MozReview-Commit-ID: LqCdcW8fmUN

--HG--
rename : layout/base/ScrollbarStyles.cpp => layout/base/ScrollStyles.cpp
rename : layout/base/ScrollbarStyles.h => layout/base/ScrollStyles.h
extra : rebase_source : 8933f3bca88d5db4b9508e3947f695ecf7511b3e
2018-08-01 16:14:26 +10:00
Boris Zbarsky
ee565cfd06 Bug 1479486. Remove some unused chromeonly history APIs on Window. r=mccr8
Well, back() is used, but only in tests, and those can use history.back().
2018-07-31 17:27:03 -04:00
Brindusan Cristian
f4c55c8456 Backed out 4 changesets (bug 1479486, bug 1479497, bug 1479475) for build bustages on builds/worker/workspace/build/src/dom/base/nsGlobalWindowInner.cpp:932:53. CLOSED TREE
Backed out changeset b75e262fac02 (bug 1479486)
Backed out changeset 45692ba0fddd (bug 1479475)
Backed out changeset 524fb20de6a2 (bug 1479475)
Backed out changeset 4663bd19da9b (bug 1479497)
2018-08-01 00:49:43 +03:00
Boris Zbarsky
261165b8f7 Bug 1479486. Remove some unused chromeonly history APIs on Window. r=mccr8
Well, back() is used, but only in tests, and those can use history.back().
2018-07-31 17:27:03 -04:00
Eugen Sawin
80290a1133 Bug 1451476 - [1.2] Add GeckoView page load error API. r=snorp,droeh,smaug 2018-07-31 20:43:33 +02:00
Boris Zbarsky
754087a992 Bug 1446940 part 5. Stop getting docshells from windows via getInterface in dom/editor/etc code. r=kmag 2018-08-01 13:07:11 -04:00
Mark Banner
4b4fb0e535 Bug 1468980 - Remove nsIDownloadHistory.idl. r=mak
MozReview-Commit-ID: IDHmOmJRJfe

--HG--
extra : rebase_source : 9f4f935740eb490ccc46620f0b4dad205289ae64
2018-07-27 15:24:53 +01:00
Kris Maglione
031076f2f3 Bug 1463291: Move docShell getter from Document to Window. r=bz
DocShells are associated with outer DOM Windows, rather than Documents, so
having the getter on the document is a bit odd to begin with. But it's also
considerably less convenient, since most of the times when we want a docShell
from JS, we're dealing most directly with a window, and have to detour through
the document to get it.

MozReview-Commit-ID: LUj1H9nG3QL

--HG--
extra : source : fcfb99baa0f0fb60a7c420a712c6ae7c72576871
extra : histedit_source : 5be9b7b29a52a4b8376ee0bdfc5c08b12e3c775a
2018-05-21 16:58:23 -07:00
Kris Maglione
02ba563399 Bug 1463016: Part 5 - Add domWindow property to DocShellTreeItem and update callers to use it. r=nika
MozReview-Commit-ID: FRRAdxLHRtG

--HG--
extra : source : 0d69b4fb1ed43751cfcbc0b4f2fe3b6a49bc0494
extra : histedit_source : d0ce31513ffaae2fd7f01f6567a97b6d2d96b797%2Cfff837de7a00fa90809d2c3e755097180dfd56d8
2018-05-20 18:10:16 -07:00