Merge autoland to mozilla-central. a=merge
authorarthur.iakab <aiakab@mozilla.com>
Thu, 11 Jul 2019 00:49:58 +0300
changeset 482319 e704e3565db9260efaa854f2916ca023b717db3c
parent 482318 c4b20b18bf97c553095f7cb3b62bb1f73b10dd14 (current diff)
parent 482257 4295df39798a266e463b3e133c6f2a0498cb2cac (diff)
child 482320 925e5936677cca99b8bbfdc6cfb2e83c7f80f2b6
child 482325 8c710c79d4a4f9a27e5124b50a8309e7ecfc3bef
push id89699
push usercsabou@mozilla.com
push dateThu, 11 Jul 2019 04:07:19 +0000
treeherderautoland@012d1b880200 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone70.0a1
first release with
nightly linux32
e704e3565db9 / 70.0a1 / 20190710215049 / files
nightly linux64
e704e3565db9 / 70.0a1 / 20190710215049 / files
nightly mac
e704e3565db9 / 70.0a1 / 20190710215049 / files
nightly win32
e704e3565db9 / 70.0a1 / 20190710215049 / files
nightly win64
e704e3565db9 / 70.0a1 / 20190710215049 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge autoland to mozilla-central. a=merge
gfx/layers/composite/AsyncCompositionManager.cpp
testing/web-platform/meta/webaudio/the-audio-api/the-audionode-interface/audionode-connect-method-chaining.html.ini
testing/web-platform/meta/webaudio/the-audio-api/the-channelmergernode-interface/audiochannelmerger-basic.html.ini
testing/web-platform/meta/webaudio/the-audio-api/the-channelmergernode-interface/ctor-channelmerger.html.ini
toolkit/components/telemetry/Histograms.json
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -111,8 +111,343 @@ d9145bdd58d06b0550ff76d6cd449fb0aa065787
 9c0e9e7467ba1697326a8f056cc11e0153e8217d # gecko-dev
 # https://hg.mozilla.org/integration/autoland/rev/d536f45f5b16
 cfc0d52d902cd58293f32a97f286a5e2a3683386 # cinnabar
 755a1a7c2f77bf360808d8470d92a8b48dd2469c # gecko-dev
 # https://hg.mozilla.org/integration/autoland/rev/d54846d01280
 abc28896717209d5f0ed2a6b0a46f8e03880ad19 # cinnabar
 47a5dd1fb80fa5bbe608c32db426f1ed29b7fd79 # gecko-dev
 
+# Bug 1561435 - Format remaining devtools/, a=automatic-formatting, CLOSED TREE
+# https://hg.mozilla.org/mozilla-central/rev/041abaa4aa85f5a776e2a6d6fa3e6874d007faad
+b8157dfaafc42deb3b9824ab6aab1c3e11636d76 # gecko-dev
+
+# Bug 1561435 - Fix test failures for devtools/server/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/80230ef725c44b076b7394ca7ca36dc817e2e26b
+66e8f7440d0a2813fa88a1e90d4c1b2537dd4393 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for devtools/server/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/ab820f7fdd388a64a447285fb2b6b1af1fb37bd1
+d8903e9911f2ee27f9f5549772dcdb2f605419ff # gecko-dev
+
+# Bug 1561435 - Format devtools/server/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/dd987949a7c2bd6fbb801748fd5d74bbf7676ed3
+24d2c754702196fe8ec396cdf1844cbbf7398392 # gecko-dev
+
+# Bug 1561435 - Update `pageError stubs file` after formatting devtools/client/ by running `browser_webconsole_update_stubs_page_error.js`, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/84db9ca75c299ea78d7f7bc9efdaf03ee83c83a5
+60b8254b35c210f2a283068ee15caf21750f49a0 # gecko-dev
+
+# Bug 1561435 - Fix test failures for devtools/client/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/6d3e80bc6e5d7e1785f66bf8b7934190bb25aa84
+e22aa772cc2fc3aaaf129a9dde2892f62e9bf8e7 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for devtools/client/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/25b5e323c763aa6d0341bfb92a1d58d1ce6f074e
+56ef3d567908850d4c72e49fb4956e124fc438fe # gecko-dev
+
+# Bug 1561435 - Format devtools/client/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/c7a227149b8fa85074c9442467c81d77081faa4e
+f6db0ee55782a171ce893389645b7ec1473bc6a6 # gecko-dev
+
+# Bug 1561435 - Format xpfe/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/0e52ffb26be74d2bae4cee9600ea6d6dcd44ed97
+7676fc16e4540c0299bdfc3c2d0a3f1dfa076df2 # gecko-dev
+
+# Bug 1561435 - Format xpcom/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/285c79c476cd11b3bcf9f1541d5c8be39b6287fe
+1fcaa7d4459c314ed3f6f9b769f3fbced5110dd4 # gecko-dev
+
+# Bug 1561435 - Format widget/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/b53e2f4066e82af48eb86f80840d4afbcb8d1ad1
+c03a3e486b93c158654f6072753f47d176db6e6c # gecko-dev
+
+# Bug 1561435 - Format view/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/06715c4f165df5f02bd18583a6676eaa034e7265
+664ac086f76bbff6d0e43ae5af27fe4d1e8b9d9a # gecko-dev
+
+# Bug 1561435 - Format uriloader/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/52e9f4dddabf88123eb835da03c74c0db2f90fce
+afb5dbbfbb1d1f497311cb4aa71e2bfba26f4d05 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for tools/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/c97b04d9be60c34e87a47e591f2830a0d09273e4
+472d3c137a21908e3fd4832dafde54dad6b30d3a # gecko-dev
+
+# Bug 1561435 - Format tools/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/2106cbe66fff3ea3be766493a665cd96c1475e12
+5c7cdbd4ba1d42ccf20c9b0818826b096dc06a8b # gecko-dev
+
+# Bug 1561435 - Fix test failures for toolkit/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/970453d65b194690181134c0271dfe675f813f81
+336c4fb8a4b4707e7f50705d5776277aa3852499 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for toolkit/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/aaadca9b31255590a2df9c0fa01dd2f25ac0f808
+815b9d372b35c82b87ac227265ff5ff902245ee0 # gecko-dev
+
+# Bug 1561435 - Format toolkit/xre/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/d8d9a53c4c13fe5cb4c6a865590f40633a12a27d
+4b7b29cff0bb8adbd743bccf3c65306c260022a2 # gecko-dev
+
+# Bug 1561435 - Format toolkit/profile/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/8be6c7ab9d2793c8d085c6868f6bb7591e3cd6bb
+463c2994cb3cadae5d03f198168671f82fcb9e44 # gecko-dev
+
+# Bug 1561435 - Format toolkit/mozapps/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/58fd5776802aa7dd7e6d3fddd7d433da5ef30426
+584e273f90666e9d070f9892ab7151813afff7a5 # gecko-dev
+
+# Bug 1561435 - Format toolkit/modules/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/e5be4c59b7f15f98fabb32a68fc64050ddb62bcb
+b503616295d69fee56300e5e2093599e6fb4f0e2 # gecko-dev
+
+# Bug 1561435 - Format toolkit/forgetaboutsite/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/b8561ed633b2d32582f0503e60aae8c95bda9ba4
+92fd7d7c3676451bf79dfc6df9b2a2726bf59447 # gecko-dev
+
+# Bug 1561435 - Format toolkit/crashreporter/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/7f9969319147bff459f4c97bcb85fc2637189805
+30de4722a3da8f88d64b9f19d05628577cc87bc0 # gecko-dev
+
+# Bug 1561435 - Format toolkit/content/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/e8bd1069715d19b1a80cff5d61fbe804b396de59
+0773795931241c0d6cdb9fc8540fae5006b1649a # gecko-dev
+
+# Bug 1561435 - Format toolkit/components/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/becae3f8f590d3e913f106aea634e86f84c80b3e
+4a06c925ac8ae7a96aa2d737ceee0508cf8df994 # gecko-dev
+
+# Bug 1561435 - Format toolkit/actors, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/a331a8e092dc59bb39f1a682f24e80fbb826e5a9
+d3a1b5aeaad92f8c3e1fd10305e811161c14b816 # gecko-dev
+
+# Bug 1561435 - Update `pageError stubs file` after formatting testing/ by running `browser_webconsole_update_stubs_page_error.js`, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/799f4b64f756bd37df5d4581998cf1fd9b305dd9
+57a6febcece83b53db098bf076baee45c5701c25 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for testing/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/b0c9aa13768f2ff899b564a9970bb4bdf4482949
+97787f6eaba0411c48f02f2992a75bff730df7c6 # gecko-dev
+
+# Bug 1561435 - Format testing/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/51c89fcec893529391427e14709a2d1bc9c2a962
+2b036e45c518c1c6d9f217d6ad6001e4a40998b1 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for taskcluster/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/1a154e62b8300000eec6e0ad38d251f939279066
+4998c97d04a3ce67df7002df568d4f5d17cdb5c8 # gecko-dev
+
+# Bug 1561435 - Format taskcluster/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/0df3e32ec2fb26b534c09dfc5a729e13884a2d35
+9b61ac048207b0bd4a5e706b3ddf3f0cc3f76b03 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for storage/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/1e3121039456ff51e0cae5ddd297be773f22b6af
+93517ce01402f161c50628aa8fd6ff15b7f4f1e7 # gecko-dev
+
+# Bug 1561435 - Format storage/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/f6fff703eb2618a94afb9018ab902ffbeaf8c199
+9eeaa5c80cc5b546c2a42de43c6f2643e78fb080 # gecko-dev
+
+# Bug 1561435 - Format startupcache/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/168bec380944da26de7ecd53222aaf94a2d2c65b
+942931c838287635f223cbf2977a3849fa843842 # gecko-dev
+
+# Bug 1561435 - Format servo/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/d40e8f24f114101d93e5ff2ace39b75e9d440382
+9a6450341744b158ef5e38eec6ba916827a722e8 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for services/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/dcd5e22d383858713ce4e73bfd66fb277fa87b5b
+34c33b48c49f10ee76e92ae5d3320bfaeb98ef7d # gecko-dev
+
+# Bug 1561435 - Format services/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/854373e1ab9e7a438d9a666d76d4cfd227a7e0ae
+9d673f1f0f8e6565db6244e4fd265025de42e75e # gecko-dev
+
+# Bug 1561435 - Fix linting errors for security/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/6ceb52b9a600947561a2f5495bbac8c262003e81
+221861fb7c9bd6bbb53099ec2016aa45a53ae288 # gecko-dev
+
+# Bug 1561435 - Format security/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/8062fdb434272ca7620c9caae8d3b8a5096c9f46
+858f3b554bd39b1a4f3af978985bdd5a23f25c69 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for remote/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/1b243b4ec0ace507906efdae9ef0725abc581e20
+77c95c13f477051c8c2b080f8c04d7448a411cc9 # gecko-dev
+
+# Bug 1561435 - Format remote/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/07ce31daca134d974d5d1ee2c86f6fdc307d9aa4
+991b3c93c6c3c2a8764688739ba4fc0469a1b229 # gecko-dev
+
+# Bug 1561435 - Format python/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/aa12389b6701bd7a6a08c9134667a25e7749aaa4
+91f67eb25e3be9fd07bf15330c76e89e91030872 # gecko-dev
+
+# Bug 1561435 - Format parser/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/ca57fd3d5fa50aaa7c7f9f77bdfc56b11467166b
+572c392d309c854e3291d5d957b71ec63514c3f8 # gecko-dev
+
+# Bug 1561435 - Format other-licenses/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/d020968b38583e0b80c8179bbce86f5b3099525b
+27cc1e60920379a11d2261fd12af9a9b9157f557 # gecko-dev
+
+# Bug 1561435 - Format nsprpub/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/17cf3eb8f0ee8ad657ccc77a34df7877a09ad13b
+9ecb4e2e8282282b76cb537a743532b9439f14be # gecko-dev
+
+# Bug 1561435 - Fix linting errors for netwerk/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/9d81554c410bd0b5d0f384fc5ceb3117bc7f5ced
+4bd76df603060181aee88593d7f9580209168356 # gecko-dev
+
+# Bug 1561435 - Format netwerk/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/d9a6985d5acd2cdd1c8e582868a5975473a78794
+2c53a5dcd94f093ac8c3c2acd77b902307662088 # gecko-dev
+
+# Bug 1561435 - Format mozglue/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/b0329baff86060df3bfd0f2aecc8ab5381056036
+ea8b91c51d0bb4d52d54fb2d453f1215bab20a95 # gecko-dev
+
+# Bug 1561435 - Format modules/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/5b0e589285f730c4f2ae3250148d4ada0e72d6b6
+8c3cfe4881e7cdb45e231d748ae7b6c56f822125 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for mobile/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/d2c1fb7f1c917b6715f3bfe98c71a0f75ddebb7d
+9e9be26a9b7428e5995b50e39114cbb65a7a7575 # gecko-dev
+
+# Bug 1561435 - Format mobile/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/d9ed067030a57dd50198c02044d999a51fe55591
+e999ae1989ac4156e3f0ae7faccb8d0c57a7ef28 # gecko-dev
+
+# Bug 1561435 - Format mfbt/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/5f1dccb626a04af3885507f110e446edad9f83a0
+1db7cbcab0f289daa90fc2a3fc39ff5f67c93b6a # gecko-dev
+
+# Bug 1561435 - Format memory/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/fe31b52c5ca48a4f0109ef8583349e32460330f4
+feaa92296b9496fa802c8c5d1a6eb2a9a27e6c8a # gecko-dev
+
+# Bug 1561435 - Format media/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/b70cef7801ae482fd042a58473fb5254c729c579
+379161a602aa945f3ab581ea40cdc9131eb1dd36 # gecko-dev
+
+# Bug 1561435 - Format layout/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/a85aec1aa92d1e067a5813a662175d4a76ce50a8
+6a261b9e7704fa1287248a642744c1d4514fc4ae # gecko-dev
+
+# Bug 1561435 - Format js/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/4b8b3495f071a07d9641c39a59edd0b95fb3d1ea
+baef0fa8174b305be79303eba9acbcab850d3b0f # gecko-dev
+
+# Bug 1561435 - Format ipc/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/d381ac512d900965a9ffef3740b5a92aed223ee2
+251f88082d5c4b543721a8a31508ad164410a245 # gecko-dev
+
+# Bug 1561435 - Format intl/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/928cc5362416f47d61bea6fc55965e5084b8204c
+d7fc67848210194e820557295ab2be1c1a8cb124 # gecko-dev
+
+# Bug 1561435 - Fix linting errors for image/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/62a5aeaf0dffe36b7157d4efe10afd0ff8369026
+2ecd1b8386d150be53f1acd9a267304a3db1c2cc # gecko-dev
+
+# Bug 1561435 - Format image/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/bcb509a14173f2e859626bc4eeaeb63b13d5dc73
+06e7696b74e079cdcfdb39f4e6def0887fb82e90 # gecko-dev
+
+# Bug 1561435 - Format hal/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/c822e46e3c168fed3aa8df3b064abedfc22aec2e
+054a393a76b590a8ace3275971e2d9bbab4ca11d # gecko-dev
+
+# Bug 1561435 - Format gradle/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/8075dd0530542c507e570f7f903d23c51e108a11
+273c6c8f77816016d79ea313b0c5cd5b48b99dce # gecko-dev
+
+# Bug 1561435 - Reposition comments in gfx/, r=kats
+# https://hg.mozilla.org/mozilla-central/rev/516d28fb9aebe12994d4bf960865ca65370b1ef6
+e974a88416d76e4b5e59503e8af23295f0a40842 # gecko-dev
+
+# Bug 1561435 - Format gfx/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/1982faa9eafa193e25814a6f328386292c8f285c
+85064fe4c35813705c1a641b5fbb6ca1f0e186c8 # gecko-dev
+
+# Bug 1561435 - Format extensions/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/599bcfdc8eee2a5c6df4bfebdf5dd94c31d6b501
+5af464dcc459d28bdbbbd9753dfa9b7a0bcfe628 # gecko-dev
+
+# Bug 1561435 - Format editor/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/05c53825de05f73ef88c89d7b9696cd69e49b7d5
+5065489a4e925b5887ee43e7171e08c65e986c88 # gecko-dev
+
+# Bug 1561435 - Avoid formatting sensitive fixtures for dom/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/6fc1f92ea98de3b3d09b783f052f56f638c583cf
+dcd795c16b2c7f3e680b9b83bfc380e56bca4ef1 # gecko-dev
+
+# Bug 1561435 - Fix test failures for dom/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/4e7dbc3bfab6fd3f1d2f2aae0df37ad1ab0e2292
+64a157bec47b9a41a328b4d5fe5f36b7a4ffca5e # gecko-dev
+
+# Bug 1561435 - Fix linting errors for dom/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/23e4bd9e52e4d74dff7f69ab0435b6770ec63791
+9bb757c75bf9414c2475460ef438889349fbf290 # gecko-dev
+
+# Bug 1561435 - Format dom/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/f3b422727b92f4933ca41fa7a4013d829a98240d
+0a8ff0ad85edf5cab74fdf16c75ce2588906177c # gecko-dev
+
+# Bug 1561435 - Format docshell/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/f63d6dbcb2436de83803c6281fdcaa5608242c15
+bcdc3a9567d90ca352829052be62ffd298926feb # gecko-dev
+
+# Bug 1561435 - Format config/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/a26eba0ab47dfb80481ff2e3d58a8e0a0424e642
+a6c398f85c2ebb90c2db9322ad3f44581f7764e7 # gecko-dev
+
+# Bug 1561435 - Format chrome/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/0bbd90cb5368ff59418cf16fcdadb2a59d61f18f
+4688ecdc4a70919a130d607b441e27f68bbcc632 # gecko-dev
+
+# Bug 1561435 - Format caps/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/0513b22f434f7b18b21d73deabfb62fd3cddbb74
+c24167d1982d5ebe9743c5a8bf8aba9e06f3fe31 # gecko-dev
+
+# Bug 1561435 - Format build/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/dfb231a91cc39dc056617bf5c18006bcbb1cd2e8
+0e8a695ad55bd89a7533bb2247d4ac095d94377a # gecko-dev
+
+# Bug 1561435 - Fix linting errors for browser/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/feb5267686912acdc1fa83dea843c3878b80fd58
+ad522e3aaee5d8d1dca1b0d280865dfab3e5698b # gecko-dev
+
+# Bug 1561435 - Format browser/tools/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/c577840a8063252f29870121b2ce8e01240db032
+645607437588ef3d0a27774d203b6adb106e5e49 # gecko-dev
+
+# Bug 1561435 - Format browser/modules/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/e8225f3e114bf1fc01f9e574cc41eb2df4e314c6
+af7d1d3b67eb3df4249b92d4678c6170e1baa0ad # gecko-dev
+
+# Bug 1561435 - Format browser/extensions/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/39b4804c504ce6b71e92aad9d8e934e1a5577b8d
+2995d5960c328801dbeabcb6e9a5032bf29ce75f # gecko-dev
+
+# Bug 1561435 - Format browser/components/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/4381f16ec9948a70802d7cc28cd021b094c7ba74
+1f830c96da027db1df4719eb54d50461fa2c8966 # gecko-dev
+
+# Bug 1561435 - Format browser/base/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/aa12d9e8a4f1cad6b8057ef69fa4b3273c3c3fab
+f9f59140398bc4d04d840e8217c04e0d7eafafb9 # gecko-dev
+
+# Bug 1561435 - Format browser/actors/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/fb99af508d47ca0bfecbe0e6be3fc3f998576d63
+55d8d8e0e00ab140088122be39f05e4cd867616a # gecko-dev
+
+# Bug 1561435 - Fix linting errors for accessible/, r=standard8
+# https://hg.mozilla.org/mozilla-central/rev/e78cfc62325608065dbb0819d2ceecf38fb0e233
+6117c06951ec8ab8a52363022667711f8bebba07 # gecko-dev
+
+# Bug 1561435 - Format accessible/, a=automatic-formatting
+# https://hg.mozilla.org/mozilla-central/rev/59f51c65dbf0c25ac557546d970c32648ab5d007
+058dce8bba0e081c60130f5523c0b9609a6bbf0f # gecko-dev
--- a/accessible/tests/crashtests/crashtests.list
+++ b/accessible/tests/crashtests/crashtests.list
@@ -1,16 +1,16 @@
 load 448064.xhtml # This test instantiates a11y, so be careful about adding tests before it
-load 471493.xul
+load chrome://reftest/content/crashtests/accessible/tests/crashtests/471493.xul
 asserts-if(!browserIsRemote,2) load 884202.html
 load 890760.html
 load 893515.html
 load 1072792.xhtml
 load 1380199.html
 load 1402999.html
 load 1463962.html
 load 1484778.html
 load 1494707.html
 load 1503964.html
 
 # last_test_to_unload_testsuite.xul MUST be the last test in the list because it
 # is responsible for shutting down accessibility service affecting later tests.
-skip-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&/^aarch64-msvc/.test(xulRuntime.XPCOMABI)) load last_test_to_unload_testsuite.xul
+skip-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&/^aarch64-msvc/.test(xulRuntime.XPCOMABI)) load chrome://reftest/content/crashtests/accessible/tests/crashtests/last_test_to_unload_testsuite.xul
--- a/browser/base/content/aboutNetError.js
+++ b/browser/base/content/aboutNetError.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* eslint-env mozilla/frame-script */
 
 const formatter = new Intl.DateTimeFormat("default");
 
 // The following parameters are parsed from the error URL:
 //   e - the error code
 //   s - custom CSS class to allow alternate styling/favicons
 //   d - error description
--- a/browser/base/content/aboutRobots.js
+++ b/browser/base/content/aboutRobots.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 var buttonClicked = false;
 var button = document.getElementById("errorTryAgain");
 button.onclick = function() {
   if (buttonClicked) {
     button.style.visibility = "hidden";
   } else {
     var newLabel = button.getAttribute("label2");
     button.textContent = newLabel;
--- a/browser/base/content/blockedSite.js
+++ b/browser/base/content/blockedSite.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 // Error url MUST be formatted like this:
 //   about:blocked?e=error_code&u=url(&o=1)?
 //     (o=1 when user overrides are allowed)
 
 // Note that this file uses document.documentURI to get
 // the URL (with the format from above). This is because
 // document.location.href gets the current URI off the docshell,
 // which is the URL displayed in the location bar, i.e.
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -1320,17 +1320,17 @@
         }
       }
 
       // Focus the location bar if it was previously focused for that tab.
       // In full screen mode, only bother making the location bar visible
       // if the tab is a blank one.
       if (newBrowser._urlbarFocused && gURLBar) {
         // Explicitly close the popup if the URL bar retains focus
-        gURLBar.closePopup();
+        gURLBar.view.close();
 
         // If the user happened to type into the URL bar for this browser
         // by the time we got here, focusing will cause the text to be
         // selected which could cause them to overwrite what they've
         // already typed in.
         if (gURLBar.focused && newBrowser.userTypedValue) {
           return;
         }
--- a/browser/branding/aurora/firefox.VisualElementsManifest.xml
+++ b/browser/branding/aurora/firefox.VisualElementsManifest.xml
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
   <VisualElements
       ShowNameOnSquare150x150Logo='on'
       Square150x150Logo='browser\VisualElements\VisualElements_150.png'
       Square70x70Logo='browser\VisualElements\VisualElements_70.png'
       ForegroundText='light'
       BackgroundColor='#14171a'/>
 </Application>
--- a/browser/branding/nightly/firefox.VisualElementsManifest.xml
+++ b/browser/branding/nightly/firefox.VisualElementsManifest.xml
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
   <VisualElements
       ShowNameOnSquare150x150Logo='on'
       Square150x150Logo='browser\VisualElements\VisualElements_150.png'
       Square70x70Logo='browser\VisualElements\VisualElements_70.png'
       ForegroundText='light'
       BackgroundColor='#000f40'/>
 </Application>
--- a/browser/branding/official/firefox.VisualElementsManifest.xml
+++ b/browser/branding/official/firefox.VisualElementsManifest.xml
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
   <VisualElements
       ShowNameOnSquare150x150Logo='on'
       Square150x150Logo='browser\VisualElements\VisualElements_150.png'
       Square70x70Logo='browser\VisualElements\VisualElements_70.png'
       ForegroundText='light'
       BackgroundColor='#000f40'/>
 </Application>
--- a/browser/branding/unofficial/firefox.VisualElementsManifest.xml
+++ b/browser/branding/unofficial/firefox.VisualElementsManifest.xml
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
   <VisualElements
       ShowNameOnSquare150x150Logo='on'
       Square150x150Logo='browser\VisualElements\VisualElements_150.png'
       Square70x70Logo='browser\VisualElements\VisualElements_70.png'
       ForegroundText='light'
       BackgroundColor='#14171a'/>
 </Application>
--- a/browser/components/BrowserContentHandler.jsm
+++ b/browser/components/BrowserContentHandler.jsm
@@ -214,16 +214,19 @@ function getPostUpdateOverridePage(updat
  *        loaded in a tab. postData will be ignored in this case.
  *        This can be a single url to load in the new window, provided as a string.
  *        postData will be used in this case if provided.
  * @param postData (optional)
  *        An nsIInputStream object to use as POST data when loading the provided
  *        url, or null.
  * @param forcePrivate (optional)
  *        Boolean. If set to true, the new window will be a private browsing one.
+ *
+ * @returns {ChromeWindow}
+ *          Returns the top level window opened.
  */
 function openBrowserWindow(
   cmdLine,
   triggeringPrincipal,
   urlOrUrlList,
   postData = null,
   forcePrivate = false
 ) {
@@ -303,17 +306,17 @@ function openBrowserWindow(
         win.docShell.QueryInterface(
           Ci.nsILoadContext
         ).usePrivateBrowsing = true;
       }
 
       win.location = chromeURL;
       win.arguments = args; // <-- needs to be a plain JS array here.
 
-      return;
+      return win;
     }
   }
 
   // We can't provide arguments to openWindow as a JS array.
   if (!urlOrUrlList) {
     // If we have a single string guaranteed to not contain '|' we can simply
     // wrap it in an nsISupportsString object.
     let [url] = args;
@@ -338,39 +341,41 @@ function openBrowserWindow(
   }
 
   let features =
     "chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine);
   if (forcePrivate) {
     features += ",private";
   }
 
-  Services.ww.openWindow(null, chromeURL, "_blank", features, args);
+  return Services.ww.openWindow(null, chromeURL, "_blank", features, args);
 }
 
 function openPreferences(cmdLine, extraArgs) {
   openBrowserWindow(cmdLine, gSystemPrincipal, "about:preferences");
 }
 
-function doSearch(searchTerm, cmdLine) {
-  var engine = Services.search.defaultEngine;
+async function doSearch(searchTerm, cmdLine) {
+  // XXXbsmedberg: use handURIToExistingBrowser to obey tabbed-browsing
+  // preferences, but need nsIBrowserDOMWindow extensions
+  // Open the window immediately as BrowserContentHandler needs to
+  // be handled synchronously. Then load the search URI when the
+  // SearchService has loaded.
+  let win = openBrowserWindow(cmdLine, gSystemPrincipal, "about:blank");
+  var engine = await Services.search.getDefault();
   var countId = (engine.identifier || "other-" + engine.name) + ".system";
   var count = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
   count.add(countId);
 
   var submission = engine.getSubmission(searchTerm, null, "system");
 
-  // XXXbsmedberg: use handURIToExistingBrowser to obey tabbed-browsing
-  // preferences, but need nsIBrowserDOMWindow extensions
-  openBrowserWindow(
-    cmdLine,
-    gSystemPrincipal,
-    submission.uri.spec,
-    submission.postData
-  );
+  win.gBrowser.selectedBrowser.loadURI(submission.uri.spec, {
+    triggeringPrincipal: gSystemPrincipal,
+    postData: submission.postData,
+  });
 }
 
 function nsBrowserContentHandler() {
   if (!gBrowserContentHandler) {
     gBrowserContentHandler = this;
   }
   return gBrowserContentHandler;
 }
--- a/browser/components/downloads/content/downloadsCommands.inc.xul
+++ b/browser/components/downloads/content/downloadsCommands.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <commandset id="downloadCommands"
             commandupdater="true"
             events="focus,select,contextmenu"
             oncommandupdate="goUpdateDownloadCommands();">
   <command id="downloadsCmd_pauseResume"
            oncommand="goDoCommand('downloadsCmd_pauseResume')"/>
   <command id="downloadsCmd_cancel"
            oncommand="goDoCommand('downloadsCmd_cancel')"/>
--- a/browser/components/downloads/content/downloadsContextMenu.inc.xul
+++ b/browser/components/downloads/content/downloadsContextMenu.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <menupopup id="downloadsContextMenu" class="download-state">
   <menuitem command="downloadsCmd_pauseResume"
             class="downloadPauseMenuItem"
             label="&cmd.pause.label;"
             accesskey="&cmd.pause.accesskey;"/>
   <menuitem command="downloadsCmd_pauseResume"
             class="downloadResumeMenuItem"
             label="&cmd.resume.label;"
--- a/browser/components/downloads/content/downloadsRichListBox.inc.xul
+++ b/browser/components/downloads/content/downloadsRichListBox.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <richlistbox flex="1"
              seltype="multiple"
              id="downloadsRichListBox" context="downloadsContextMenu"
              onscroll="return this._placesView.onScroll();"
              onkeypress="return this._placesView.onKeyPress(event);"
              ondblclick="return this._placesView.onDoubleClick(event);"
              oncontextmenu="return this._placesView.onContextMenu(event);"
              ondragstart="this._placesView.onDragStart(event);"
--- a/browser/components/downloads/content/downloadsStrings.inc.xul
+++ b/browser/components/downloads/content/downloadsStrings.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 # Don't add new strings here, use properties files instead. This file won't be
 # necessary anymore once localization is converted to Fluent (bug 1452637).
 
 <stringbundleset id="downloadsStrings"
   string-download-cancel="&cmd.cancel.label;"
   string-download-cancel-description="&cancelDownload.label;"
   string-download-open-file-description="&openFile.label;"
   string-download-open-or-remove-file="&cmd.chooseOpen.label;"
--- a/browser/components/extensions/ExtensionPopups.jsm
+++ b/browser/components/extensions/ExtensionPopups.jsm
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /* exported PanelPopup, ViewPopup */
 
 var EXPORTED_SYMBOLS = ["BasePopup", "PanelPopup", "ViewPopup"];
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
--- a/browser/components/extensions/child/ext-browser-content-only.js
+++ b/browser/components/extensions/child/ext-browser-content-only.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 extensions.registerModules({
   menusChild: {
     url: "chrome://browser/content/child/ext-menus-child.js",
     scopes: ["content_child"],
     paths: [["menus"]],
   },
--- a/browser/components/extensions/child/ext-browser.js
+++ b/browser/components/extensions/child/ext-browser.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 extensions.registerModules({
   devtools: {
     url: "chrome://browser/content/child/ext-devtools.js",
     scopes: ["devtools_child"],
     paths: [["devtools"]],
   },
--- a/browser/components/extensions/child/ext-devtools-inspectedWindow.js
+++ b/browser/components/extensions/child/ext-devtools-inspectedWindow.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.devtools_inspectedWindow = class extends ExtensionAPI {
   getAPI(context) {
     // `devtoolsToolboxInfo` is received from the child process when the root devtools view
     // has been created, and every sub-frame of that top level devtools frame will
     // receive the same information when the context has been created from the
     // `ExtensionChild.createExtensionContext` method.
--- a/browser/components/extensions/child/ext-devtools-network.js
+++ b/browser/components/extensions/child/ext-devtools-network.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * Responsible for fetching HTTP response content from the backend.
  *
  * @param {DevtoolsExtensionContext}
  *   A devtools extension context running in a child process.
  * @param {object} options
--- a/browser/components/extensions/child/ext-devtools-panels.js
+++ b/browser/components/extensions/child/ext-devtools-panels.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
 
--- a/browser/components/extensions/child/ext-devtools.js
+++ b/browser/components/extensions/child/ext-devtools.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.devtools = class extends ExtensionAPI {
   getAPI(context) {
     return {
       devtools: {},
     };
   }
--- a/browser/components/extensions/child/ext-menus-child.js
+++ b/browser/components/extensions/child/ext-menus-child.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "ContextMenuChild",
   "resource:///actors/ContextMenuChild.jsm"
 );
 
--- a/browser/components/extensions/child/ext-menus.js
+++ b/browser/components/extensions/child/ext-menus.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "Services",
   "resource://gre/modules/Services.jsm"
 );
 
--- a/browser/components/extensions/child/ext-omnibox.js
+++ b/browser/components/extensions/child/ext-omnibox.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.omnibox = class extends ExtensionAPI {
   getAPI(context) {
     return {
       omnibox: {
         onInputChanged: new EventManager({
           context,
--- a/browser/components/extensions/child/ext-tabs.js
+++ b/browser/components/extensions/child/ext-tabs.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.tabs = class extends ExtensionAPI {
   getAPI(context) {
     return {
       tabs: {
         connect: function(tabId, connectInfo) {
           let name = "";
--- a/browser/components/extensions/parent/ext-bookmarks.js
+++ b/browser/components/extensions/parent/ext-bookmarks.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { PlacesUtils } = ChromeUtils.import(
   "resource://gre/modules/PlacesUtils.jsm"
 );
 
 var { ExtensionError } = ExtensionUtils;
 
--- a/browser/components/extensions/parent/ext-browser.js
+++ b/browser/components/extensions/parent/ext-browser.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 // This file provides some useful code for the |tabs| and |windows|
 // modules. All of the code is installed on |global|, which is a scope
 // shared among the different ext-*.js scripts.
 
 ChromeUtils.defineModuleGetter(
   this,
--- a/browser/components/extensions/parent/ext-browserAction.js
+++ b/browser/components/extensions/parent/ext-browserAction.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm"
 );
 ChromeUtils.defineModuleGetter(
--- a/browser/components/extensions/parent/ext-browsingData.js
+++ b/browser/components/extensions/parent/ext-browsingData.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { PlacesUtils } = ChromeUtils.import(
   "resource://gre/modules/PlacesUtils.jsm"
 );
 
 ChromeUtils.defineModuleGetter(
   this,
--- a/browser/components/extensions/parent/ext-commands.js
+++ b/browser/components/extensions/parent/ext-commands.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "ExtensionShortcuts",
   "resource://gre/modules/ExtensionShortcuts.jsm"
 );
 
--- a/browser/components/extensions/parent/ext-devtools-inspectedWindow.js
+++ b/browser/components/extensions/parent/ext-devtools-inspectedWindow.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { SpreadArgs } = ExtensionCommon;
 
 this.devtools_inspectedWindow = class extends ExtensionAPI {
   getAPI(context) {
     // Lazily retrieved inspectedWindow actor front per child context.
     let waitForInspectedWindowFront;
--- a/browser/components/extensions/parent/ext-devtools-network.js
+++ b/browser/components/extensions/parent/ext-devtools-network.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { SpreadArgs } = ExtensionCommon;
 
 var { ExtensionError } = ExtensionUtils;
 
 this.devtools_network = class extends ExtensionAPI {
   getAPI(context) {
--- a/browser/components/extensions/parent/ext-devtools-panels.js
+++ b/browser/components/extensions/parent/ext-devtools-panels.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { ExtensionParent } = ChromeUtils.import(
   "resource://gre/modules/ExtensionParent.jsm"
 );
 
 var { IconDetails, watchExtensionProxyContextLoad } = ExtensionParent;
 
--- a/browser/components/extensions/parent/ext-devtools.js
+++ b/browser/components/extensions/parent/ext-devtools.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * This module provides helpers used by the other specialized `ext-devtools-*.js` modules
  * and the implementation of the `devtools_page`.
  */
 
 ChromeUtils.defineModuleGetter(
--- a/browser/components/extensions/parent/ext-find.js
+++ b/browser/components/extensions/parent/ext-find.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* global tabTracker */
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm"
 );
--- a/browser/components/extensions/parent/ext-history.js
+++ b/browser/components/extensions/parent/ext-history.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { PlacesUtils } = ChromeUtils.import(
   "resource://gre/modules/PlacesUtils.jsm"
 );
 
 ChromeUtils.defineModuleGetter(
   this,
--- a/browser/components/extensions/parent/ext-menus.js
+++ b/browser/components/extensions/parent/ext-menus.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.defineModuleGetter(
   this,
   "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm"
 );
--- a/browser/components/extensions/parent/ext-normandyAddonStudy.js
+++ b/browser/components/extensions/parent/ext-normandyAddonStudy.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 const { AddonStudies } = ChromeUtils.import(
   "resource://normandy/lib/AddonStudies.jsm"
 );
 const { ClientID } = ChromeUtils.import("resource://gre/modules/ClientID.jsm");
 
 ChromeUtils.defineModuleGetter(
--- a/browser/components/extensions/parent/ext-omnibox.js
+++ b/browser/components/extensions/parent/ext-omnibox.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "ExtensionSearchHandler",
   "resource://gre/modules/ExtensionSearchHandler.jsm"
 );
 
--- a/browser/components/extensions/parent/ext-pageAction.js
+++ b/browser/components/extensions/parent/ext-pageAction.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "ExtensionTelemetry",
   "resource://gre/modules/ExtensionTelemetry.jsm"
 );
 ChromeUtils.defineModuleGetter(
--- a/browser/components/extensions/parent/ext-pkcs11.js
+++ b/browser/components/extensions/parent/ext-pkcs11.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   ctypes: "resource://gre/modules/ctypes.jsm",
   NativeManifests: "resource://gre/modules/NativeManifests.jsm",
   OS: "resource://gre/modules/osfile.jsm",
 });
 
--- a/browser/components/extensions/parent/ext-sessions.js
+++ b/browser/components/extensions/parent/ext-sessions.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { ExtensionError, promiseObserved } = ExtensionUtils;
 
 ChromeUtils.defineModuleGetter(
   this,
   "AddonManagerPrivate",
   "resource://gre/modules/AddonManager.jsm"
--- a/browser/components/extensions/parent/ext-sidebarAction.js
+++ b/browser/components/extensions/parent/ext-sidebarAction.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 var { ExtensionParent } = ChromeUtils.import(
   "resource://gre/modules/ExtensionParent.jsm"
 );
 
 var { ExtensionError } = ExtensionUtils;
 
--- a/browser/components/extensions/parent/ext-tabs.js
+++ b/browser/components/extensions/parent/ext-tabs.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "BrowserUtils",
   "resource://gre/modules/BrowserUtils.jsm"
 );
 ChromeUtils.defineModuleGetter(
--- a/browser/components/extensions/parent/ext-urlbar.js
+++ b/browser/components/extensions/parent/ext-urlbar.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
   UrlbarProviderExtension: "resource:///modules/UrlbarProviderExtension.jsm",
 });
 
 var { ExtensionPreferencesManager } = ChromeUtils.import(
--- a/browser/components/extensions/parent/ext-windows.js
+++ b/browser/components/extensions/parent/ext-windows.js
@@ -1,10 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 ChromeUtils.defineModuleGetter(
   this,
   "HomePage",
   "resource:///modules/HomePage.jsm"
 );
 ChromeUtils.defineModuleGetter(
--- a/browser/components/newtab/bin/render-activity-stream-html.js
+++ b/browser/components/newtab/bin/render-activity-stream-html.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* eslint-disable no-console */
 const fs = require("fs");
 const { mkdir } = require("shelljs");
 const path = require("path");
 
 // Note: DEFAULT_OPTIONS.baseUrl should match BASE_URL in aboutNewTabService.js
 //       in mozilla-central.
 const DEFAULT_OPTIONS = {
--- a/browser/components/newtab/bin/vendor.js
+++ b/browser/components/newtab/bin/vendor.js
@@ -1,9 +1,12 @@
 #!/usr/bin/env node
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* eslint-disable no-console */
 
 const { cp, set } = require("shelljs");
 const path = require("path");
 
 const filesToVendor = {
   // XXX currently these two licenses are identical.  Perhaps we should check
--- a/browser/components/newtab/common/Dedupe.jsm
+++ b/browser/components/newtab/common/Dedupe.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 this.Dedupe = class Dedupe {
   constructor(createKey) {
     this.createKey = createKey || this.defaultCreateKey;
   }
 
   defaultCreateKey(item) {
     return item;
   }
--- a/browser/components/newtab/common/PerfService.jsm
+++ b/browser/components/newtab/common/PerfService.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 if (typeof ChromeUtils !== "undefined") {
   // Use a var here instead of let outside to avoid creating a locally scoped
   // variable that hides the global, which we modify for testing.
   // eslint-disable-next-line no-var, vars-on-top
   var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 }
--- a/browser/components/newtab/content-src/activity-stream.jsx
+++ b/browser/components/newtab/content-src/activity-stream.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { Base } from "content-src/components/Base/Base";
 import { DetectUserSessionStart } from "content-src/lib/detect-user-session-start";
 import { initStore } from "content-src/lib/init-store";
 import { Provider } from "react-redux";
 import React from "react";
 import ReactDOM from "react-dom";
 import { reducers } from "common/Reducers.jsm";
--- a/browser/components/newtab/content-src/asrouter/asrouter-content.jsx
+++ b/browser/components/newtab/content-src/asrouter/asrouter-content.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { OUTGOING_MESSAGE_NAME as AS_GENERAL_OUTGOING_MESSAGE_NAME } from "content-src/lib/init-store";
 import { generateBundles } from "./rich-text-strings";
 import { ImpressionsWrapper } from "./components/ImpressionsWrapper/ImpressionsWrapper";
 import { LocalizationProvider } from "fluent-react";
 import { NEWTAB_DARK_THEME } from "content-src/lib/constants";
 import { OnboardingMessage } from "./templates/OnboardingMessage/OnboardingMessage";
 import React from "react";
--- a/browser/components/newtab/content-src/asrouter/components/Button/Button.jsx
+++ b/browser/components/newtab/content-src/asrouter/components/Button/Button.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 const ALLOWED_STYLE_TAGS = ["color", "backgroundColor"];
 
 export const Button = props => {
   const style = {};
 
   // Add allowed style tags from props, e.g. props.color becomes style={color: props.color}
--- a/browser/components/newtab/content-src/asrouter/components/ConditionalWrapper/ConditionalWrapper.jsx
+++ b/browser/components/newtab/content-src/asrouter/components/ConditionalWrapper/ConditionalWrapper.jsx
@@ -1,3 +1,7 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 // lifted from https://gist.github.com/kitze/23d82bb9eb0baabfd03a6a720b1d637f
 export const ConditionalWrapper = ({ condition, wrap, children }) =>
   condition ? wrap(children) : children;
--- a/browser/components/newtab/content-src/asrouter/components/ImpressionsWrapper/ImpressionsWrapper.jsx
+++ b/browser/components/newtab/content-src/asrouter/components/ImpressionsWrapper/ImpressionsWrapper.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export const VISIBLE = "visible";
 export const VISIBILITY_CHANGE_EVENT = "visibilitychange";
 
 /**
  * Component wrapper used to send telemetry pings on every impression.
  */
--- a/browser/components/newtab/content-src/asrouter/components/ModalOverlay/ModalOverlay.jsx
+++ b/browser/components/newtab/content-src/asrouter/components/ModalOverlay/ModalOverlay.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class ModalOverlayWrapper extends React.PureComponent {
   constructor(props) {
     super(props);
     this.onKeyDown = this.onKeyDown.bind(this);
   }
 
--- a/browser/components/newtab/content-src/asrouter/components/RichText/RichText.jsx
+++ b/browser/components/newtab/content-src/asrouter/components/RichText/RichText.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { Localized } from "fluent-react";
 import React from "react";
 import { RICH_TEXT_KEYS } from "../../rich-text-strings";
 import { safeURI } from "../../template-utils";
 
 // Elements allowed in snippet content
 const ALLOWED_TAGS = {
   b: <b />,
--- a/browser/components/newtab/content-src/asrouter/components/SnippetBase/SnippetBase.jsx
+++ b/browser/components/newtab/content-src/asrouter/components/SnippetBase/SnippetBase.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import schema from "../../templates/SimpleSnippet/SimpleSnippet.schema.json";
 
 export class SnippetBase extends React.PureComponent {
   constructor(props) {
     super(props);
     this.onBlockClicked = this.onBlockClicked.bind(this);
     this.onDismissClicked = this.onDismissClicked.bind(this);
--- a/browser/components/newtab/content-src/asrouter/rich-text-strings.js
+++ b/browser/components/newtab/content-src/asrouter/rich-text-strings.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { FluentBundle } from "fluent";
 
 /**
  * Properties that allow rich text MUST be added to this list.
  *   key: the localization_id that should be used
  *   value: a property or array of properties on the message.content object
  */
 const RICH_TEXT_CONFIG = {
--- a/browser/components/newtab/content-src/asrouter/template-utils.js
+++ b/browser/components/newtab/content-src/asrouter/template-utils.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 export function safeURI(url) {
   if (!url) {
     return "";
   }
   const { protocol } = new URL(url);
   const isAllowed = [
     "http:",
     "https:",
--- a/browser/components/newtab/content-src/asrouter/templates/EOYSnippet/EOYSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/EOYSnippet/EOYSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import schema from "./EOYSnippet.schema.json";
 import { SimpleSnippet } from "../SimpleSnippet/SimpleSnippet";
 
 class EOYSnippetBase extends React.PureComponent {
   constructor(props) {
     super(props);
     this.handleSubmit = this.handleSubmit.bind(this);
--- a/browser/components/newtab/content-src/asrouter/templates/FXASignupSnippet/FXASignupSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/FXASignupSnippet/FXASignupSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import schema from "./FXASignupSnippet.schema.json";
 import { SubmitFormSnippet } from "../SubmitFormSnippet/SubmitFormSnippet.jsx";
 
 export const FXASignupSnippet = props => {
   const userAgent = window.navigator.userAgent.match(/Firefox\/([0-9]+)\./);
   const firefox_version = userAgent ? parseInt(userAgent[1], 10) : 0;
   const extendedContent = {
--- a/browser/components/newtab/content-src/asrouter/templates/NewsletterSnippet/NewsletterSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/NewsletterSnippet/NewsletterSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import schema from "./NewsletterSnippet.schema.json";
 import { SubmitFormSnippet } from "../SubmitFormSnippet/SubmitFormSnippet.jsx";
 
 export const NewsletterSnippet = props => {
   const extendedContent = {
     scene1_button_label: schema.properties.scene1_button_label.default,
     scene2_email_placeholder_text:
--- a/browser/components/newtab/content-src/asrouter/templates/OnboardingMessage/OnboardingMessage.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/OnboardingMessage/OnboardingMessage.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { ModalOverlay } from "../../components/ModalOverlay/ModalOverlay";
 import React from "react";
 
 const FLUENT_FILES = [
   "branding/brand.ftl",
   "browser/branding/sync-brand.ftl",
   "browser/newtab/onboarding.ftl",
 ];
--- a/browser/components/newtab/content-src/asrouter/templates/ReturnToAMO/ReturnToAMO.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/ReturnToAMO/ReturnToAMO.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import { RichText } from "../../components/RichText/RichText";
 
 // Alt text if available; in the future this should come from the server. See bug 1551711
 const ICON_ALT_TEXT = "";
 
 export class ReturnToAMO extends React.PureComponent {
   constructor(props) {
--- a/browser/components/newtab/content-src/asrouter/templates/SendToDeviceSnippet/SendToDeviceSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/SendToDeviceSnippet/SendToDeviceSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { isEmailOrPhoneNumber } from "./isEmailOrPhoneNumber";
 import React from "react";
 import schema from "./SendToDeviceSnippet.schema.json";
 import { SubmitFormSnippet } from "../SubmitFormSnippet/SubmitFormSnippet.jsx";
 
 function validateInput(value, content) {
   const type = isEmailOrPhoneNumber(value, content);
   return type ? "" : "Must be an email or a phone number.";
--- a/browser/components/newtab/content-src/asrouter/templates/SendToDeviceSnippet/isEmailOrPhoneNumber.js
+++ b/browser/components/newtab/content-src/asrouter/templates/SendToDeviceSnippet/isEmailOrPhoneNumber.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /**
  * Checks if a given string is an email or phone number or neither
  * @param {string} val The user input
  * @param {ASRMessageContent} content .content property on ASR message
  * @returns {"email"|"phone"|""} The type of the input
  */
 export function isEmailOrPhoneNumber(val, content) {
   const { locale } = content;
--- a/browser/components/newtab/content-src/asrouter/templates/SimpleBelowSearchSnippet/SimpleBelowSearchSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/SimpleBelowSearchSnippet/SimpleBelowSearchSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import { RichText } from "../../components/RichText/RichText";
 import { safeURI } from "../../template-utils";
 import { SnippetBase } from "../../components/SnippetBase/SnippetBase";
 
 const DEFAULT_ICON_PATH = "chrome://branding/content/icon64.png";
 // Alt text placeholder in case the prop from the server isn't available
 const ICON_ALT_TEXT = "";
--- a/browser/components/newtab/content-src/asrouter/templates/SimpleSnippet/SimpleSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/SimpleSnippet/SimpleSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { Button } from "../../components/Button/Button";
 import { ConditionalWrapper } from "../../components/ConditionalWrapper/ConditionalWrapper";
 import React from "react";
 import { RichText } from "../../components/RichText/RichText";
 import { safeURI } from "../../template-utils";
 import { SnippetBase } from "../../components/SnippetBase/SnippetBase";
 
 const DEFAULT_ICON_PATH = "chrome://branding/content/icon64.png";
--- a/browser/components/newtab/content-src/asrouter/templates/StartupOverlay/StartupOverlay.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/StartupOverlay/StartupOverlay.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { connect } from "react-redux";
 import React from "react";
 
 const FLUENT_FILES = [
   "branding/brand.ftl",
   "browser/branding/sync-brand.ftl",
   "browser/newtab/onboarding.ftl",
--- a/browser/components/newtab/content-src/asrouter/templates/SubmitFormSnippet/SubmitFormSnippet.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/SubmitFormSnippet/SubmitFormSnippet.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { Button } from "../../components/Button/Button";
 import React from "react";
 import { RichText } from "../../components/RichText/RichText";
 import { safeURI } from "../../template-utils";
 import { SimpleSnippet } from "../SimpleSnippet/SimpleSnippet";
 import { SnippetBase } from "../../components/SnippetBase/SnippetBase";
 
 // Alt text placeholder in case the prop from the server isn't available
--- a/browser/components/newtab/content-src/asrouter/templates/Trailhead/Trailhead.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/Trailhead/Trailhead.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { ModalOverlayWrapper } from "../../components/ModalOverlay/ModalOverlay";
 import { OnboardingCard } from "../OnboardingMessage/OnboardingMessage";
 import React from "react";
 
 const FLUENT_FILES = [
   "branding/brand.ftl",
   "browser/branding/brandings.ftl",
--- a/browser/components/newtab/content-src/asrouter/templates/template-manifest.jsx
+++ b/browser/components/newtab/content-src/asrouter/templates/template-manifest.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { EOYSnippet } from "./EOYSnippet/EOYSnippet";
 import { FXASignupSnippet } from "./FXASignupSnippet/FXASignupSnippet";
 import { NewsletterSnippet } from "./NewsletterSnippet/NewsletterSnippet";
 import { SendToDeviceSnippet } from "./SendToDeviceSnippet/SendToDeviceSnippet";
 import { SimpleBelowSearchSnippet } from "./SimpleBelowSearchSnippet/SimpleBelowSearchSnippet";
 import { SimpleSnippet } from "./SimpleSnippet/SimpleSnippet";
 
 // Key names matching schema name of templates
--- a/browser/components/newtab/content-src/components/A11yLinkButton/A11yLinkButton.jsx
+++ b/browser/components/newtab/content-src/components/A11yLinkButton/A11yLinkButton.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export function A11yLinkButton(props) {
   // function for merging classes, if necessary
   let className = "a11y-link-button";
   if (props.className) {
     className += ` ${props.className}`;
   }
--- a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx
+++ b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { ASRouterUtils } from "../../asrouter/asrouter-content";
 import { connect } from "react-redux";
 import { ModalOverlay } from "../../asrouter/components/ModalOverlay/ModalOverlay";
 import React from "react";
 import { SimpleHashRouter } from "./SimpleHashRouter";
 
 const Row = props => (
--- a/browser/components/newtab/content-src/components/ASRouterAdmin/SimpleHashRouter.jsx
+++ b/browser/components/newtab/content-src/components/ASRouterAdmin/SimpleHashRouter.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class SimpleHashRouter extends React.PureComponent {
   constructor(props) {
     super(props);
     this.onHashChange = this.onHashChange.bind(this);
     this.state = { hash: global.location.hash };
   }
--- a/browser/components/newtab/content-src/components/Base/Base.jsx
+++ b/browser/components/newtab/content-src/components/Base/Base.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { ASRouterAdmin } from "content-src/components/ASRouterAdmin/ASRouterAdmin";
 import { ASRouterUISurface } from "../../asrouter/asrouter-content";
 import { ConfirmDialog } from "content-src/components/ConfirmDialog/ConfirmDialog";
 import { connect } from "react-redux";
 import { DiscoveryStreamBase } from "content-src/components/DiscoveryStreamBase/DiscoveryStreamBase";
 import { ErrorBoundary } from "content-src/components/ErrorBoundary/ErrorBoundary";
 import React from "react";
--- a/browser/components/newtab/content-src/components/Card/Card.jsx
+++ b/browser/components/newtab/content-src/components/Card/Card.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { cardContextTypes } from "./types";
 import { connect } from "react-redux";
 import { LinkMenu } from "content-src/components/LinkMenu/LinkMenu";
 import React from "react";
 import { ScreenshotUtils } from "content-src/lib/screenshot-utils";
 
 // Keep track of pending image loads to only request once
--- a/browser/components/newtab/content-src/components/Card/types.js
+++ b/browser/components/newtab/content-src/components/Card/types.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 export const cardContextTypes = {
   history: {
     fluentID: "newtab-label-visited",
     icon: "history-item",
   },
   bookmark: {
     fluentID: "newtab-label-bookmarked",
     icon: "bookmark-added",
--- a/browser/components/newtab/content-src/components/CollapsibleSection/CollapsibleSection.jsx
+++ b/browser/components/newtab/content-src/components/CollapsibleSection/CollapsibleSection.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { ErrorBoundary } from "content-src/components/ErrorBoundary/ErrorBoundary";
 import { FluentOrText } from "content-src/components/FluentOrText/FluentOrText";
 import React from "react";
 import { SectionMenu } from "content-src/components/SectionMenu/SectionMenu";
 import { SectionMenuOptions } from "content-src/lib/section-menu-options";
 
 const VISIBLE = "visible";
--- a/browser/components/newtab/content-src/components/ComponentPerfTimer/ComponentPerfTimer.jsx
+++ b/browser/components/newtab/content-src/components/ComponentPerfTimer/ComponentPerfTimer.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { perfService as perfSvc } from "common/PerfService.jsm";
 import React from "react";
 
 // Currently record only a fixed set of sections. This will prevent data
 // from custom sections from showing up or from topstories.
 const RECORDED_SECTIONS = ["highlights", "topsites"];
 
--- a/browser/components/newtab/content-src/components/ConfirmDialog/ConfirmDialog.jsx
+++ b/browser/components/newtab/content-src/components/ConfirmDialog/ConfirmDialog.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes } from "common/Actions.jsm";
 import { connect } from "react-redux";
 import React from "react";
 
 /**
  * ConfirmDialog component.
  * One primary action button, one cancel button.
  *
--- a/browser/components/newtab/content-src/components/ContextMenu/ContextMenu.jsx
+++ b/browser/components/newtab/content-src/components/ContextMenu/ContextMenu.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class ContextMenu extends React.PureComponent {
   constructor(props) {
     super(props);
     this.hideContext = this.hideContext.bind(this);
     this.onShow = this.onShow.bind(this);
     this.onClick = this.onClick.bind(this);
--- a/browser/components/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamBase/DiscoveryStreamBase.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { CardGrid } from "content-src/components/DiscoveryStreamComponents/CardGrid/CardGrid";
 import { CollapsibleSection } from "content-src/components/CollapsibleSection/CollapsibleSection";
 import { connect } from "react-redux";
 import { DSMessage } from "content-src/components/DiscoveryStreamComponents/DSMessage/DSMessage";
 import { Hero } from "content-src/components/DiscoveryStreamComponents/Hero/Hero";
 import { Highlights } from "content-src/components/DiscoveryStreamComponents/Highlights/Highlights";
 import { HorizontalRule } from "content-src/components/DiscoveryStreamComponents/HorizontalRule/HorizontalRule";
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/CardGrid/CardGrid.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/CardGrid/CardGrid.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { DSCard, PlaceholderDSCard } from "../DSCard/DSCard.jsx";
 import { DSEmptyState } from "../DSEmptyState/DSEmptyState.jsx";
 import React from "react";
 
 export class CardGrid extends React.PureComponent {
   renderCards() {
     const recs = this.props.data.recommendations.slice(0, this.props.items);
     const cards = [];
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSCard/DSCard.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { DSImage } from "../DSImage/DSImage.jsx";
 import { DSLinkMenu } from "../DSLinkMenu/DSLinkMenu";
 import { ImpressionStats } from "../../DiscoveryStreamImpressionStats/ImpressionStats";
 import React from "react";
 import { SafeAnchor } from "../SafeAnchor/SafeAnchor";
 
 export class DSCard extends React.PureComponent {
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSEmptyState/DSEmptyState.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSEmptyState/DSEmptyState.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import React from "react";
 
 export class DSEmptyState extends React.PureComponent {
   constructor(props) {
     super(props);
     this.onReset = this.onReset.bind(this);
     this.state = {};
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSImage/DSImage.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSImage/DSImage.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import ReactDOM from "react-dom";
 
 export class DSImage extends React.PureComponent {
   constructor(props) {
     super(props);
 
     this.onOptimizedImageError = this.onOptimizedImageError.bind(this);
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSLinkMenu/DSLinkMenu.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSLinkMenu/DSLinkMenu.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { LinkMenu } from "content-src/components/LinkMenu/LinkMenu";
 import React from "react";
 
 export class DSLinkMenu extends React.PureComponent {
   constructor(props) {
     super(props);
     this.state = {
       activeCard: null,
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSMessage/DSMessage.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/DSMessage/DSMessage.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import { SafeAnchor } from "../SafeAnchor/SafeAnchor";
 
 export class DSMessage extends React.PureComponent {
   render() {
     return (
       <div className="ds-message">
         <header className="title">
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Hero/Hero.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Hero/Hero.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { DSCard, PlaceholderDSCard } from "../DSCard/DSCard.jsx";
 import { actionCreators as ac } from "common/Actions.jsm";
 import { DSEmptyState } from "../DSEmptyState/DSEmptyState.jsx";
 import { DSImage } from "../DSImage/DSImage.jsx";
 import { DSLinkMenu } from "../DSLinkMenu/DSLinkMenu";
 import { ImpressionStats } from "../../DiscoveryStreamImpressionStats/ImpressionStats";
 import { List } from "../List/List.jsx";
 import React from "react";
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Highlights/Highlights.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Highlights/Highlights.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { connect } from "react-redux";
 import React from "react";
 import { SectionIntl } from "content-src/components/Sections/Sections";
 
 export class _Highlights extends React.PureComponent {
   render() {
     const section = this.props.Sections.find(s => s.id === "highlights");
     if (!section || !section.enabled) {
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/HorizontalRule/HorizontalRule.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/HorizontalRule/HorizontalRule.jsx
@@ -1,7 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class HorizontalRule extends React.PureComponent {
   render() {
     return <hr className="ds-hr" />;
   }
 }
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/List/List.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/List/List.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { connect } from "react-redux";
 import { DSEmptyState } from "../DSEmptyState/DSEmptyState.jsx";
 import { DSImage } from "../DSImage/DSImage.jsx";
 import { DSLinkMenu } from "../DSLinkMenu/DSLinkMenu";
 import { ImpressionStats } from "../../DiscoveryStreamImpressionStats/ImpressionStats";
 import React from "react";
 import { SafeAnchor } from "../SafeAnchor/SafeAnchor";
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Navigation/Navigation.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Navigation/Navigation.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 import { SafeAnchor } from "../SafeAnchor/SafeAnchor";
 
 export class Topic extends React.PureComponent {
   render() {
     const { url, name } = this.props;
     return (
       <li>
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/SafeAnchor/SafeAnchor.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/SafeAnchor/SafeAnchor.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import React from "react";
 
 export class SafeAnchor extends React.PureComponent {
   constructor(props) {
     super(props);
     this.onClick = this.onClick.bind(this);
   }
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/SectionTitle/SectionTitle.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class SectionTitle extends React.PureComponent {
   render() {
     const {
       header: { title, subtitle },
     } = this.props;
     return (
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopSites/TopSites.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopSites/TopSites.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { connect } from "react-redux";
 import { TopSites as OldTopSites } from "content-src/components/TopSites/TopSites";
 import React from "react";
 
 export class _TopSites extends React.PureComponent {
   render() {
     const header = this.props.header || {};
     return (
--- a/browser/components/newtab/content-src/components/DiscoveryStreamImpressionStats/ImpressionStats.jsx
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamImpressionStats/ImpressionStats.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import React from "react";
 
 const VISIBLE = "visible";
 const VISIBILITY_CHANGE_EVENT = "visibilitychange";
 
 // Per analytical requirement, we set the minimal intersection ratio to
 // 0.5, and an impression is identified when the wrapped item has at least
--- a/browser/components/newtab/content-src/components/ErrorBoundary/ErrorBoundary.jsx
+++ b/browser/components/newtab/content-src/components/ErrorBoundary/ErrorBoundary.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { A11yLinkButton } from "content-src/components/A11yLinkButton/A11yLinkButton";
 import React from "react";
 
 export class ErrorBoundaryFallback extends React.PureComponent {
   constructor(props) {
     super(props);
     this.windowObj = this.props.windowObj || window;
     this.onClick = this.onClick.bind(this);
--- a/browser/components/newtab/content-src/components/FluentOrText/FluentOrText.jsx
+++ b/browser/components/newtab/content-src/components/FluentOrText/FluentOrText.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 /**
  * Set text on a child element/component depending on if the message is already
  * translated plain text or a fluent id with optional args.
  */
 export class FluentOrText extends React.PureComponent {
   render() {
--- a/browser/components/newtab/content-src/components/LinkMenu/LinkMenu.jsx
+++ b/browser/components/newtab/content-src/components/LinkMenu/LinkMenu.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { connect } from "react-redux";
 import { ContextMenu } from "content-src/components/ContextMenu/ContextMenu";
 import { LinkMenuOptions } from "content-src/lib/link-menu-options";
 import React from "react";
 
 const DEFAULT_SITE_MENU_OPTIONS = [
   "CheckPinTopSite",
--- a/browser/components/newtab/content-src/components/MoreRecommendations/MoreRecommendations.jsx
+++ b/browser/components/newtab/content-src/components/MoreRecommendations/MoreRecommendations.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class MoreRecommendations extends React.PureComponent {
   render() {
     const { read_more_endpoint } = this.props;
     if (read_more_endpoint) {
       return (
         <a
--- a/browser/components/newtab/content-src/components/PocketLoggedInCta/PocketLoggedInCta.jsx
+++ b/browser/components/newtab/content-src/components/PocketLoggedInCta/PocketLoggedInCta.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { connect } from "react-redux";
 import React from "react";
 
 export class _PocketLoggedInCta extends React.PureComponent {
   render() {
     const { pocketCta } = this.props.Pocket;
     return (
       <span className="pocket-logged-in-cta">
--- a/browser/components/newtab/content-src/components/Search/Search.jsx
+++ b/browser/components/newtab/content-src/components/Search/Search.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals ContentSearchUIController */
 "use strict";
 
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { connect } from "react-redux";
 import { IS_NEWTAB } from "content-src/lib/constants";
 import React from "react";
 
--- a/browser/components/newtab/content-src/components/SectionMenu/SectionMenu.jsx
+++ b/browser/components/newtab/content-src/components/SectionMenu/SectionMenu.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac } from "common/Actions.jsm";
 import { ContextMenu } from "content-src/components/ContextMenu/ContextMenu";
 import React from "react";
 import { SectionMenuOptions } from "content-src/lib/section-menu-options";
 
 const DEFAULT_SECTION_MENU_OPTIONS = [
   "MoveUp",
   "MoveDown",
--- a/browser/components/newtab/content-src/components/Sections/Sections.jsx
+++ b/browser/components/newtab/content-src/components/Sections/Sections.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { Card, PlaceholderCard } from "content-src/components/Card/Card";
 import { CollapsibleSection } from "content-src/components/CollapsibleSection/CollapsibleSection";
 import { ComponentPerfTimer } from "content-src/components/ComponentPerfTimer/ComponentPerfTimer";
 import { FluentOrText } from "content-src/components/FluentOrText/FluentOrText";
 import { connect } from "react-redux";
 import { MoreRecommendations } from "content-src/components/MoreRecommendations/MoreRecommendations";
 import { PocketLoggedInCta } from "content-src/components/PocketLoggedInCta/PocketLoggedInCta";
--- a/browser/components/newtab/content-src/components/TopSites/SearchShortcutsForm.jsx
+++ b/browser/components/newtab/content-src/components/TopSites/SearchShortcutsForm.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import React from "react";
 import { TOP_SITES_SOURCE } from "./TopSitesConstants";
 
 export class SelectableSearchShortcut extends React.PureComponent {
   render() {
     const { shortcut, selected } = this.props;
     const imageStyle = { backgroundImage: `url("${shortcut.tippyTopIcon}")` };
--- a/browser/components/newtab/content-src/components/TopSites/TopSite.jsx
+++ b/browser/components/newtab/content-src/components/TopSites/TopSite.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import {
   MIN_CORNER_FAVICON_SIZE,
   MIN_RICH_FAVICON_SIZE,
   TOP_SITES_CONTEXT_MENU_OPTIONS,
   TOP_SITES_SEARCH_SHORTCUTS_CONTEXT_MENU_OPTIONS,
   TOP_SITES_SOURCE,
 } from "./TopSitesConstants";
--- a/browser/components/newtab/content-src/components/TopSites/TopSiteForm.jsx
+++ b/browser/components/newtab/content-src/components/TopSites/TopSiteForm.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { A11yLinkButton } from "content-src/components/A11yLinkButton/A11yLinkButton";
 import React from "react";
 import { TOP_SITES_SOURCE } from "./TopSitesConstants";
 import { TopSiteFormInput } from "./TopSiteFormInput";
 import { TopSiteLink } from "./TopSite";
 
 export class TopSiteForm extends React.PureComponent {
--- a/browser/components/newtab/content-src/components/TopSites/TopSiteFormInput.jsx
+++ b/browser/components/newtab/content-src/components/TopSites/TopSiteFormInput.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class TopSiteFormInput extends React.PureComponent {
   constructor(props) {
     super(props);
     this.state = { validationError: this.props.validationError };
     this.onChange = this.onChange.bind(this);
     this.onMount = this.onMount.bind(this);
--- a/browser/components/newtab/content-src/components/TopSites/TopSites.jsx
+++ b/browser/components/newtab/content-src/components/TopSites/TopSites.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import {
   MIN_CORNER_FAVICON_SIZE,
   MIN_RICH_FAVICON_SIZE,
   TOP_SITES_SOURCE,
 } from "./TopSitesConstants";
 import { CollapsibleSection } from "content-src/components/CollapsibleSection/CollapsibleSection";
 import { ComponentPerfTimer } from "content-src/components/ComponentPerfTimer/ComponentPerfTimer";
--- a/browser/components/newtab/content-src/components/TopSites/TopSitesConstants.js
+++ b/browser/components/newtab/content-src/components/TopSites/TopSitesConstants.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 export const TOP_SITES_SOURCE = "TOP_SITES";
 export const TOP_SITES_CONTEXT_MENU_OPTIONS = [
   "CheckPinTopSite",
   "EditTopSite",
   "Separator",
   "OpenInNewWindow",
   "OpenInPrivateWindow",
   "Separator",
--- a/browser/components/newtab/content-src/components/Topics/Topics.jsx
+++ b/browser/components/newtab/content-src/components/Topics/Topics.jsx
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import React from "react";
 
 export class Topic extends React.PureComponent {
   render() {
     const { url, name } = this.props;
     return (
       <li>
         <a key={name} href={url}>
--- a/browser/components/newtab/content-src/lib/constants.js
+++ b/browser/components/newtab/content-src/lib/constants.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 export const IS_NEWTAB =
   global.document && global.document.documentURI === "about:newtab";
 export const NEWTAB_DARK_THEME = {
   ntp_background: {
     r: 42,
     g: 42,
     b: 46,
     a: 1,
--- a/browser/components/newtab/content-src/lib/detect-user-session-start.js
+++ b/browser/components/newtab/content-src/lib/detect-user-session-start.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 import { perfService as perfSvc } from "common/PerfService.jsm";
 
 const VISIBLE = "visible";
 const VISIBILITY_CHANGE_EVENT = "visibilitychange";
 
 export class DetectUserSessionStart {
   constructor(store, options = {}) {
--- a/browser/components/newtab/content-src/lib/init-store.js
+++ b/browser/components/newtab/content-src/lib/init-store.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* eslint-env mozilla/frame-script */
 
 import {
   actionCreators as ac,
   actionTypes as at,
   actionUtils as au,
 } from "common/Actions.jsm";
 import { applyMiddleware, combineReducers, createStore } from "redux";
--- a/browser/components/newtab/content-src/lib/link-menu-options.js
+++ b/browser/components/newtab/content-src/lib/link-menu-options.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 
 const _OpenInPrivateWindow = site => ({
   id: "newtab-menu-open-new-private-window",
   icon: "new-window-private",
   action: ac.OnlyToMain({
     type: at.OPEN_PRIVATE_WINDOW,
     data: { url: site.url, referrer: site.referrer },
--- a/browser/components/newtab/content-src/lib/screenshot-utils.js
+++ b/browser/components/newtab/content-src/lib/screenshot-utils.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /**
  * List of helper functions for screenshot-based images.
  *
  * There are two kinds of images:
  * 1. Remote Image: This is the image from the main process and it refers to
  *    the image in the React props. This can either be an object with the `data`
  *    and `path` properties, if it is a blob, or a string, if it is a normal image.
  * 2. Local Image: This is the image object in the content process and it refers
--- a/browser/components/newtab/content-src/lib/section-menu-options.js
+++ b/browser/components/newtab/content-src/lib/section-menu-options.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 import { actionCreators as ac, actionTypes as at } from "common/Actions.jsm";
 
 /**
  * List of functions that return items that can be included as menu options in a
  * SectionMenu. All functions take the section as the only parameter.
  */
 export const SectionMenuOptions = {
   Separator: () => ({ type: "separator" }),
--- a/browser/components/newtab/content-src/lib/selectLayoutRender.js
+++ b/browser/components/newtab/content-src/lib/selectLayoutRender.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 export const selectLayoutRender = (state, prefs, rickRollCache) => {
   const { layout, feeds, spocs } = state;
   let spocIndex = 0;
   let bufferRollCache = [];
   // Records the chosen and unchosen spocs by the probability selection.
   let chosenSpocs = new Set();
   let unchosenSpocs = new Set();
 
--- a/browser/components/newtab/data/content/activity-stream.bundle.js
+++ b/browser/components/newtab/data/content/activity-stream.bundle.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
 /******/
 /******/ 	// The require function
 /******/ 	function __webpack_require__(moduleId) {
 /******/
 /******/ 		// Check if module is in cache
--- a/browser/components/newtab/karma.mc.config.js
+++ b/browser/components/newtab/karma.mc.config.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const path = require("path");
 
 const PATHS = {
   // Where is the entry point for the unit tests?
   testEntryFile: path.resolve(__dirname, "test/unit/unit-entry.js"),
 
   // A glob-style pattern matching all unit tests
   testFilesPattern: "test/unit/**/*.js",
--- a/browser/components/newtab/lib/ASRouterFeed.jsm
+++ b/browser/components/newtab/lib/ASRouterFeed.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const { actionTypes: at } = ChromeUtils.import(
   "resource://activity-stream/common/Actions.jsm"
 );
 const { ASRouter } = ChromeUtils.import(
   "resource://activity-stream/lib/ASRouter.jsm"
 );
 
 /**
--- a/browser/components/newtab/lib/ASRouterTargeting.jsm
+++ b/browser/components/newtab/lib/ASRouterTargeting.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const { FilterExpressions } = ChromeUtils.import(
   "resource://gre/modules/components-utils/FilterExpressions.jsm"
 );
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(
   this,
   "ASRouterPreferences",
--- a/browser/components/newtab/lib/ActivityStreamStorage.jsm
+++ b/browser/components/newtab/lib/ActivityStreamStorage.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 ChromeUtils.defineModuleGetter(
   this,
   "IndexedDB",
   "resource://gre/modules/IndexedDB.jsm"
 );
 
 this.ActivityStreamStorage = class ActivityStreamStorage {
   /**
--- a/browser/components/newtab/lib/DownloadsManager.jsm
+++ b/browser/components/newtab/lib/DownloadsManager.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
 
 const { actionTypes: at } = ChromeUtils.import(
   "resource://activity-stream/common/Actions.jsm"
 );
--- a/browser/components/newtab/lib/ShortURL.jsm
+++ b/browser/components/newtab/lib/ShortURL.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(
   this,
   "IDNService",
--- a/browser/components/newtab/loaders/inject-loader.js
+++ b/browser/components/newtab/loaders/inject-loader.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 // Note: this is based on https://github.com/plasticine/inject-loader,
 // patched to make istanbul work properly
 
 const loaderUtils = require("loader-utils");
 const QUOTE_REGEX_STRING = "['|\"]{1}";
 
 const hasOnlyExcludeFlags = query =>
   Object.keys(query).filter(key => query[key] === true).length === 0;
--- a/browser/components/newtab/prerendered/activity-stream-debug.html
+++ b/browser/components/newtab/prerendered/activity-stream-debug.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!doctype html>
 <html>
   <head>
     <meta charset="utf-8">
     <meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'; script-src resource: chrome:; connect-src https:; img-src https: data: blob:; style-src 'unsafe-inline';">
     <title data-l10n-id="newtab-page-title"></title>
     <link rel="icon" type="image/png" href="chrome://branding/content/icon32.png"/>
     <link rel="localization" href="browser/branding/brandings.ftl" />
--- a/browser/components/newtab/prerendered/activity-stream-noscripts.html
+++ b/browser/components/newtab/prerendered/activity-stream-noscripts.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!doctype html>
 <html>
   <head>
     <meta charset="utf-8">
     <meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'; script-src resource: chrome:; connect-src https:; img-src https: data: blob:; style-src 'unsafe-inline';">
     <title data-l10n-id="newtab-page-title"></title>
     <link rel="icon" type="image/png" href="chrome://branding/content/icon32.png"/>
     <link rel="localization" href="browser/branding/brandings.ftl" />
--- a/browser/components/newtab/prerendered/activity-stream.html
+++ b/browser/components/newtab/prerendered/activity-stream.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!doctype html>
 <html>
   <head>
     <meta charset="utf-8">
     <meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'; script-src resource: chrome:; connect-src https:; img-src https: data: blob:; style-src 'unsafe-inline';">
     <title data-l10n-id="newtab-page-title"></title>
     <link rel="icon" type="image/png" href="chrome://branding/content/icon32.png"/>
     <link rel="localization" href="browser/branding/brandings.ftl" />
--- a/browser/components/newtab/webpack.aboutlibrary.config.js
+++ b/browser/components/newtab/webpack.aboutlibrary.config.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const path = require("path");
 const config = require("./webpack.system-addon.config.js");
 const absolute = relPath => path.join(__dirname, relPath);
 module.exports = Object.assign({}, config(), {
   entry: absolute("content-src/aboutlibrary/aboutlibrary.jsx"),
   output: {
     path: absolute("aboutlibrary/content"),
     filename: "aboutlibrary.bundle.js",
--- a/browser/components/newtab/webpack.system-addon.config.js
+++ b/browser/components/newtab/webpack.system-addon.config.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 const path = require("path");
 const webpack = require("webpack");
 
 const absolute = relPath => path.join(__dirname, relPath);
 
 const resourcePathRegEx = /^resource:\/\/activity-stream\//;
 
 module.exports = (env = {}) => ({
--- a/browser/components/payments/server.py
+++ b/browser/components/payments/server.py
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 from __future__ import absolute_import
 import BaseHTTPServer
 from SimpleHTTPServer import SimpleHTTPRequestHandler
 
 
 class RequestHandler(SimpleHTTPRequestHandler, object):
     def translate_path(self, path):
         # Map autofill paths to their own directory
--- a/browser/components/places/content/bookmarksHistoryTooltip.inc.xul
+++ b/browser/components/places/content/bookmarksHistoryTooltip.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <!-- Bookmarks and history tooltip -->
 <tooltip id="bhTooltip" noautohide="true"
          onpopupshowing="return window.top.BookmarksEventHandler.fillInBHTooltip(document, event)">
   <vbox id="bhTooltipTextBox" flex="1">
     <description id="bhtTitleText" class="tooltip-label" />
     <description id="bhtUrlText" crop="center" class="tooltip-label uri-element" />
   </vbox>
 </tooltip>
--- a/browser/components/places/content/editBookmarkPanel.inc.xul
+++ b/browser/components/places/content/editBookmarkPanel.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <vbox id="editBookmarkPanelContent" flex="1">
   <hbox id="editBMPanel_selectionCount" pack="center">
     <label id="editBMPanel_itemsCountText"/>
   </hbox>
 
   <vbox id="editBookmarkPanelRows">
     <vbox id="editBMPanel_nameRow"
           collapsed="true">
--- a/browser/components/places/content/placesCommands.inc.xul
+++ b/browser/components/places/content/placesCommands.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <commandset id="placesCommands"
             commandupdater="true"
             events="focus,sort,places"
             oncommandupdate="PlacesUIUtils.updateCommands(window);">
   <command id="Browser:ShowAllBookmarks"
            oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"/>
   <command id="Browser:ShowAllHistory"
            oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
--- a/browser/components/places/content/placesContextMenu.inc.xul
+++ b/browser/components/places/content/placesContextMenu.inc.xul
@@ -1,8 +1,12 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
 <menupopup id="placesContext"
            onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
                            if (!PlacesUIUtils.openInTabClosesMenu) {
                              document.getElementById('placesContext_open:newtab')
                              .setAttribute('closemenu', 'single');
                            }
                            return this._view.buildContextMenu(this);"
            onpopuphiding="this._view.destroyContextMenu();">
--- a/browser/components/preferences/in-content/search.inc.xul
+++ b/browser/components/preferences/in-content/search.inc.xul
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
     <script src="chrome://browser/content/preferences/in-content/search.js"/>
     <html:template id="template-paneSearch">
     <hbox id="searchCategory"
           class="subcategory"
           hidden="true"
           data-category="paneSearch">
       <html:h1 data-l10n-id="pane-search-title"/>
     </hbox>
--- a/browser/components/sessionstore/test/browser_522375.js
+++ b/browser/components/sessionstore/test/browser_522375.js
@@ -1,29 +1,16 @@
 function test() {
   var startup_info = Services.startup.getStartupInfo();
   // No .process info on mac
 
-  // Check if we encountered a telemetry error for the the process creation
-  // timestamp and turn the first test into a known failure.
-  var snapshot = Services.telemetry
-    .getHistogramById("STARTUP_MEASUREMENT_ERRORS")
-    .snapshot();
-
-  if (snapshot.values[0] == 0) {
-    ok(
-      startup_info.process <= startup_info.main,
-      "process created before main is run " + uneval(startup_info)
-    );
-  } else {
-    todo(
-      false,
-      "An error occurred while recording the process creation timestamp, skipping this test"
-    );
-  }
+  ok(
+    startup_info.process <= startup_info.main,
+    "process created before main is run " + uneval(startup_info)
+  );
 
   // on linux firstPaint can happen after everything is loaded (especially with remote X)
   if (startup_info.firstPaint) {
     ok(
       startup_info.main <= startup_info.firstPaint,
       "main ran before first paint " + uneval(startup_info)
     );
   }
--- a/browser/components/uitour/UITour.jsm
+++ b/browser/components/uitour/UITour.jsm
@@ -1614,17 +1614,17 @@ var UITour = {
       aWindow.PanelUI.hide();
     } else if (aMenuName == "bookmarks") {
       let menuBtn = aWindow.document.getElementById("bookmarks-menu-button");
       closeMenuButton(menuBtn);
     } else if (aMenuName == "controlCenter") {
       let panel = aWindow.gIdentityHandler._identityPopup;
       panel.hidePopup();
     } else if (aMenuName == "urlbar") {
-      aWindow.gURLBar.closePopup();
+      aWindow.gURLBar.view.close();
     } else if (aMenuName == "pageActionPanel") {
       aWindow.BrowserPageActions.panelNode.hidePopup();
     }
   },
 
   showNewTab(aWindow, aBrowser) {
     aWindow.gURLBar.focus();
     let url = "about:newtab";
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -296,25 +296,16 @@ class UrlbarInput {
    */
   formatValue() {
     // The editor may not exist if the toolbar is not visible.
     if (this.editor) {
       this.valueFormatter.update();
     }
   }
 
-  /**
-   * This exists for legacy compatibility, and can be removed once the old
-   * urlbar code goes away, by changing callers. Internal consumers should use
-   * view.close().
-   */
-  closePopup() {
-    this.view.close();
-  }
-
   focus() {
     this.inputField.focus();
   }
 
   blur() {
     this.inputField.blur();
   }
 
@@ -495,16 +486,22 @@ class UrlbarInput {
       this._loadURL(this.value, where, openParams);
       return;
     }
 
     let { url, postData } = UrlbarUtils.getUrlFromResult(result);
     openParams.postData = postData;
 
     switch (result.type) {
+      case UrlbarUtils.RESULT_TYPE.KEYWORD: {
+        // If this result comes from a bookmark keyword, let it inherit the
+        // current document's principal, otherwise bookmarklets would break.
+        openParams.allowInheritPrincipal = true;
+        break;
+      }
       case UrlbarUtils.RESULT_TYPE.TAB_SWITCH: {
         if (this.hasAttribute("actionoverride")) {
           where = "current";
           break;
         }
 
         this.handleRevert();
         let prevTab = this.window.gBrowser.selectedTab;
--- a/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
+++ b/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
@@ -281,17 +281,24 @@ function makeUrlbarResult(tokens, info) 
                 !action.params.searchQuery.trim() &&
                 action.params.alias.startsWith("@"),
               false,
             ],
           })
         );
       case "keyword": {
         let title = info.comment;
-        if (tokens && tokens.length > 1) {
+        if (!title) {
+          // If the url doesn't have an host (e.g. javascript urls), comment
+          // will be empty, and we can't build the usual title. Thus use the url.
+          title = Services.textToSubURI.unEscapeURIForUI(
+            "UTF-8",
+            action.params.url
+          );
+        } else if (tokens && tokens.length > 1) {
           title = bundle.formatStringFromName("bookmarkKeywordSearch", [
             info.comment,
             tokens
               .slice(1)
               .map(t => t.value)
               .join(" "),
           ]);
         }
--- a/browser/components/urlbar/UrlbarProvidersManager.jsm
+++ b/browser/components/urlbar/UrlbarProvidersManager.jsm
@@ -352,16 +352,17 @@ class Query {
     // heuristic result though, that is supposed to be added regardless.
     if (!this.acceptableSources.includes(match.source) && !match.heuristic) {
       return;
     }
 
     // Filter out javascript results for safety. The provider is supposed to do
     // it, but we don't want to risk leaking these out.
     if (
+      match.type != UrlbarUtils.RESULT_TYPE.KEYWORD &&
       match.payload.url &&
       match.payload.url.startsWith("javascript:") &&
       !this.context.searchString.startsWith("javascript:") &&
       UrlbarPrefs.get("filter.javascript")
     ) {
       return;
     }
 
--- a/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js
+++ b/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js
@@ -1,58 +1,116 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-add_task(async function test_keyword_bookmarklet() {
-  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
+add_task(async function setup() {
   let bm = await PlacesUtils.bookmarks.insert({
     parentGuid: PlacesUtils.bookmarks.unfiledGuid,
     title: "bookmarklet",
-    url: "javascript:'1';",
+    url: "javascript:'%s'%20",
   });
-
+  await PlacesUtils.keywords.insert({ keyword: "bm", url: bm.url });
   registerCleanupFunction(async function() {
-    BrowserTestUtils.removeTab(tab);
     await PlacesUtils.bookmarks.remove(bm);
   });
 
-  let originalPrincipal = gBrowser.contentPrincipal;
-  let originalPrincipalURI = await getPrincipalURI(tab.linkedBrowser);
-
-  await PlacesUtils.keywords.insert({ keyword: "bm", url: "javascript:'1';" });
-
-  // Enter bookmarklet keyword in the URL bar
-  gURLBar.value = "bm";
-  gURLBar.focus();
-  EventUtils.synthesizeKey("KEY_Enter");
-
-  await BrowserTestUtils.waitForContentEvent(
-    gBrowser.selectedBrowser,
-    "pageshow"
-  );
-
-  let newPrincipalURI = await getPrincipalURI(tab.linkedBrowser);
-  is(newPrincipalURI, originalPrincipalURI, "content has the same principal");
-
-  // In e10s, null principals don't round-trip so the same null principal sent
-  // from the child will be a new null principal. Verify that this is the
-  // case.
-  if (tab.linkedBrowser.isRemoteBrowser) {
-    ok(
-      originalPrincipal.isNullPrincipal &&
-        gBrowser.contentPrincipal.isNullPrincipal,
-      "both principals should be null principals in the parent"
-    );
-  } else {
-    ok(
-      gBrowser.contentPrincipal.equals(originalPrincipal),
-      "javascript bookmarklet should inherit principal"
-    );
+  let testFns = [
+    function() {
+      info("Type keyword and immediately press enter");
+      gURLBar.value = "bm";
+      gURLBar.focus();
+      EventUtils.synthesizeKey("KEY_Enter");
+      return "javascript:''%20";
+    },
+    function() {
+      info("Type keyword with searchstring and immediately press enter");
+      gURLBar.value = "bm a";
+      gURLBar.focus();
+      EventUtils.synthesizeKey("KEY_Enter");
+      return "javascript:'a'%20";
+    },
+    async function() {
+      info("Search keyword, then press enter");
+      await promiseAutocompleteResultPopup("bm");
+      let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
+      Assert.equal(result.title, "javascript:'' ", "Check title");
+      EventUtils.synthesizeKey("KEY_Enter");
+      return "javascript:''%20";
+    },
+    async function() {
+      info("Search keyword with searchstring, then press enter");
+      await promiseAutocompleteResultPopup("bm a");
+      let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
+      Assert.equal(result.title, "javascript:'a' ", "Check title");
+      EventUtils.synthesizeKey("KEY_Enter");
+      return "javascript:'a'%20";
+    },
+    async function() {
+      await promiseAutocompleteResultPopup("bm");
+      let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
+      Assert.equal(result.title, "javascript:'' ", "Check title");
+      let element = UrlbarTestUtils.getSelectedElement(window);
+      EventUtils.synthesizeMouseAtCenter(element, {});
+      return "javascript:''%20";
+    },
+    async function() {
+      info("Search keyword with searchstring, then click");
+      await promiseAutocompleteResultPopup("bm a");
+      let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
+      Assert.equal(result.title, "javascript:'a' ", "Check title");
+      let element = UrlbarTestUtils.getSelectedElement(window);
+      EventUtils.synthesizeMouseAtCenter(element, {});
+      return "javascript:'a'%20";
+    },
+  ];
+  for (let testFn of testFns) {
+    await do_test(testFn);
   }
 });
 
+async function do_test(loadFn) {
+  await BrowserTestUtils.withNewTab(
+    {
+      gBrowser,
+    },
+    async browser => {
+      let originalPrincipal = gBrowser.contentPrincipal;
+      let originalPrincipalURI = await getPrincipalURI(browser);
+
+      let promise = BrowserTestUtils.waitForContentEvent(browser, "pageshow");
+      let expectedUrl = await loadFn();
+      info("Awaiting pageshow event");
+      await promise;
+      Assert.equal(gBrowser.currentURI.spec, expectedUrl);
+
+      let newPrincipalURI = await getPrincipalURI(browser);
+      Assert.equal(
+        newPrincipalURI,
+        originalPrincipalURI,
+        "content has the same principal"
+      );
+
+      // In e10s, null principals don't round-trip so the same null principal sent
+      // from the child will be a new null principal. Verify that this is the
+      // case.
+      if (browser.isRemoteBrowser) {
+        Assert.ok(
+          originalPrincipal.isNullPrincipal &&
+            gBrowser.contentPrincipal.isNullPrincipal,
+          "both principals should be null principals in the parent"
+        );
+      } else {
+        Assert.ok(
+          gBrowser.contentPrincipal.equals(originalPrincipal),
+          "javascript bookmarklet should inherit principal"
+        );
+      }
+    }
+  );
+}
+
 function getPrincipalURI(browser) {
   return ContentTask.spawn(browser, null, function() {
     return content.document.nodePrincipal.URI.spec;
   });
 }
--- a/browser/docs/AddressBar.rst
+++ b/browser/docs/AddressBar.rst
@@ -302,18 +302,16 @@ Implements an input box *View*, owns an 
 
   UrlbarInput {
     constructor(options = { textbox, panel, controller });
     // Used to trim urls when necessary (e.g. removing "http://")
     trimValue();
     // Uses UrlbarValueFormatter to highlight the base host, search aliases
     // and to keep the host visible on overflow.
     formatValue(val);
-    // Manage view visibility.
-    closePopup();
     openResults();
     // Converts an internal URI (e.g. a URI with a username or password) into
     // one which we can expose to the user.
     makeURIReadable(uri);
     // Handles an event which would cause a url or text to be opened.
     handleCommand();
     // Called by the view when a result is selected.
     resultsSelected();
--- a/browser/extensions/formautofill/background.js
+++ b/browser/extensions/formautofill/background.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* eslint-env webextensions */
 
 "use strict";
 
 browser.runtime.onUpdateAvailable.addListener(details => {
   // By listening to but ignoring this event, any updates will
   // be delayed until the next browser restart.
   // Note that if we ever wanted to change this, we should make
--- a/browser/extensions/screenshots/assertIsBlankDocument.js
+++ b/browser/extensions/screenshots/assertIsBlankDocument.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /** For use inside an iframe onload function, throws an Error if iframe src is not blank.html
 
     Should be applied *inside* catcher.watchFunction
 */
 this.assertIsBlankDocument = function assertIsBlankDocument(doc) {
   if (doc.documentURI !== browser.extension.getURL("blank.html")) {
     const exc = new Error("iframe URL does not match expected blank.html");
     exc.foundURL = doc.documentURI;
--- a/browser/extensions/screenshots/assertIsTrusted.js
+++ b/browser/extensions/screenshots/assertIsTrusted.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /** For use with addEventListener, assures that any events have event.isTrusted set to true
       https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted
     Should be applied *inside* catcher.watchFunction
 */
 this.assertIsTrusted = function assertIsTrusted(handlerFunction) {
   return function(event) {
     if (!event) {
       const exc = new Error("assertIsTrusted did not get an event");
--- a/browser/extensions/screenshots/background/analytics.js
+++ b/browser/extensions/screenshots/background/analytics.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals main, auth, browser, catcher, deviceInfo, communication, log */
 
 "use strict";
 
 this.analytics = (function() {
   const exports = {};
 
   const GA_PORTION = 0.1; // 10% of users will send to the server/GA
--- a/browser/extensions/screenshots/background/auth.js
+++ b/browser/extensions/screenshots/background/auth.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals log */
 /* globals main, makeUuid, deviceInfo, analytics, catcher, buildSettings, communication */
 
 "use strict";
 
 this.auth = (function() {
   const exports = {};
 
--- a/browser/extensions/screenshots/background/communication.js
+++ b/browser/extensions/screenshots/background/communication.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals catcher, log */
 
 "use strict";
 
 this.communication = (function() {
   const exports = {};
 
   const registeredFunctions = {};
--- a/browser/extensions/screenshots/background/deviceInfo.js
+++ b/browser/extensions/screenshots/background/deviceInfo.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals catcher */
 
 "use strict";
 
 this.deviceInfo = (function() {
   const manifest = browser.runtime.getManifest();
 
   let platformInfo = {};
--- a/browser/extensions/screenshots/background/main.js
+++ b/browser/extensions/screenshots/background/main.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals selectorLoader, analytics, communication, catcher, log, makeUuid, auth, senderror, startBackground, blobConverters buildSettings */
 
 "use strict";
 
 this.main = (function() {
   const exports = {};
 
   const pasteSymbol = (window.navigator.platform.match(/Mac/i)) ? "\u2318" : "Ctrl";
--- a/browser/extensions/screenshots/background/selectorLoader.js
+++ b/browser/extensions/screenshots/background/selectorLoader.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals catcher, communication, log, main */
 
 "use strict";
 
 // eslint-disable-next-line no-var
 var global = this;
 
 this.selectorLoader = (function() {
--- a/browser/extensions/screenshots/background/senderror.js
+++ b/browser/extensions/screenshots/background/senderror.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals startBackground, analytics, communication, makeUuid, Raven, catcher, auth, log */
 
 "use strict";
 
 this.senderror = (function() {
   const exports = {};
 
   const manifest = browser.runtime.getManifest();
--- a/browser/extensions/screenshots/background/startBackground.js
+++ b/browser/extensions/screenshots/background/startBackground.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals browser, main, communication, manifest */
 /* This file handles:
      clicks on the WebExtension page action
      browser.contextMenus.onClicked
      browser.runtime.onMessage
    and loads the rest of the background page in response to those events, forwarding
    the events to main.onClicked, main.onClickedContextMenu, or communication.onMessage
 */
--- a/browser/extensions/screenshots/background/takeshot.js
+++ b/browser/extensions/screenshots/background/takeshot.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals communication, shot, main, auth, catcher, analytics, buildSettings, blobConverters, thumbnailGenerator */
 
 "use strict";
 
 this.takeshot = (function() {
   const exports = {};
   const Shot = shot.AbstractShot;
   const { sendEvent, incrementCount } = analytics;
--- a/browser/extensions/screenshots/blank.html
+++ b/browser/extensions/screenshots/blank.html
@@ -1,1 +1,5 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <html></html>
--- a/browser/extensions/screenshots/blobConverters.js
+++ b/browser/extensions/screenshots/blobConverters.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 this.blobConverters = (function() {
   const exports = {};
 
   exports.dataUrlToBlob = function(url) {
     const binary = atob(url.split(",", 2)[1]);
     let contentType = exports.getTypeFromDataUrl(url);
     if (contentType !== "image/png" && contentType !== "image/jpeg") {
       contentType = "image/png";
--- a/browser/extensions/screenshots/build/buildSettings.js
+++ b/browser/extensions/screenshots/build/buildSettings.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 window.buildSettings = {
   defaultSentryDsn: "https://904ccdd4866247c092ae8fc1a4764a63:940d44bdc71d4daea133c19080ccd38d@sentry.prod.mozaws.net/224",
   logLevel: "" || "warn",
   captureText: ("" === "true"),
   uploadBinary: ("" === "true"),
   pngToJpegCutoff: parseInt("" || 2500000, 10),
   maxImageHeight: parseInt("" || 10000, 10),
   maxImageWidth: parseInt("" || 10000, 10)
--- a/browser/extensions/screenshots/build/inlineSelectionCss.js
+++ b/browser/extensions/screenshots/build/inlineSelectionCss.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* Created from build/server/static/css/inline-selection.css */
 window.inlineSelectionCss = `
 .button, .highlight-button-cancel, .highlight-button-download, .highlight-button-copy {
   display: flex;
   align-items: center;
   justify-content: center;
   border: 0;
   border-radius: 3px;
--- a/browser/extensions/screenshots/build/onboardingCss.js
+++ b/browser/extensions/screenshots/build/onboardingCss.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* Created from build/server/static/css/onboarding.css */
 window.onboardingCss = `
 .loader {
   background: rgba(12, 12, 13, 0.2);
   border-radius: 2px;
   height: 4px;
   overflow: hidden;
   position: relative;
--- a/browser/extensions/screenshots/build/onboardingHtml.js
+++ b/browser/extensions/screenshots/build/onboardingHtml.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* Created from webextension/onboarding/slides.html */
 window.onboardingHtml = `
 <!DOCTYPE html>
 <html>
   <head>
     <!-- onboarding.scss is automatically inserted here: -->
     <style></style>
     <!-- Here and in onboarding.scss use MOZ_EXTENSION/path to refer to local files -->
--- a/browser/extensions/screenshots/build/selection.js
+++ b/browser/extensions/screenshots/build/selection.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 this.selection = (function () {let exports={}; class Selection {
   constructor(x1, y1, x2, y2) {
     this.x1 = x1;
     this.y1 = y1;
     this.x2 = x2;
     this.y2 = y2;
   }
 
--- a/browser/extensions/screenshots/build/shot.js
+++ b/browser/extensions/screenshots/build/shot.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 this.shot = (function () {let exports={}; // Note: in this library we can't use any "system" dependencies because this can be used from multiple
 // environments
 
 const isNode = typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]";
 const URL = (isNode && require("url").URL) || window.URL;
 
 /** Throws an error if the condition isn't true.  Any extra arguments after the condition
     are used as console.error() arguments. */
--- a/browser/extensions/screenshots/build/thumbnailGenerator.js
+++ b/browser/extensions/screenshots/build/thumbnailGenerator.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 this.thumbnailGenerator = (function () {let exports={}; // This is used in webextension/background/takeshot.js,
 // server/src/pages/shot/controller.js, and
 // server/scr/pages/shotindex/view.js. It is used in a browser
 // environment.
 
 // Resize down 1/2 at a time produces better image quality.
 // Not quite as good as using a third-party filter (which will be
 // slower), but good enough.
--- a/browser/extensions/screenshots/catcher.js
+++ b/browser/extensions/screenshots/catcher.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 // eslint-disable-next-line no-var
 var global = this;
 
 this.catcher = (function() {
   const exports = {};
 
--- a/browser/extensions/screenshots/clipboard.js
+++ b/browser/extensions/screenshots/clipboard.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals catcher, assertIsBlankDocument */
 
 "use strict";
 
 this.clipboard = (function() {
   const exports = {};
 
   exports.copy = function(text) {
--- a/browser/extensions/screenshots/domainFromUrl.js
+++ b/browser/extensions/screenshots/domainFromUrl.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /** Returns the domain of a URL, but safely and in ASCII; URLs without domains
     (such as about:blank) return the scheme, Unicode domains get stripped down
     to ASCII */
 
 "use strict";
 
 this.domainFromUrl = (function() {
 
--- a/browser/extensions/screenshots/experiments/screenshots/api.js
+++ b/browser/extensions/screenshots/experiments/screenshots/api.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals browser, AppConstants, CustomizableUI, ExtensionCommon, Services, ExtensionAPI */
 
 "use strict";
 
 ChromeUtils.defineModuleGetter(this, "AppConstants",
                                "resource://gre/modules/AppConstants.jsm");
 ChromeUtils.defineModuleGetter(this, "CustomizableUI",
                                "resource:///modules/CustomizableUI.jsm");
--- a/browser/extensions/screenshots/log.js
+++ b/browser/extensions/screenshots/log.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals buildSettings */
 /* eslint-disable no-console */
 
 "use strict";
 
 this.log = (function() {
   const exports = {};
 
--- a/browser/extensions/screenshots/makeUuid.js
+++ b/browser/extensions/screenshots/makeUuid.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.makeUuid = (function() {
 
   // generates a v4 UUID
   return function makeUuid() { // eslint-disable-line no-unused-vars
     // get sixteen unsigned 8 bit random values
     const randomValues = window
--- a/browser/extensions/screenshots/onboarding/slides.html
+++ b/browser/extensions/screenshots/onboarding/slides.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE html>
 <html>
   <head>
     <!-- onboarding.scss is automatically inserted here: -->
     <style></style>
     <!-- Here and in onboarding.scss use MOZ_EXTENSION/path to refer to local files -->
   </head>
   <body>
--- a/browser/extensions/screenshots/onboarding/slides.js
+++ b/browser/extensions/screenshots/onboarding/slides.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals log, catcher, onboardingHtml, onboardingCss, util, shooter, callBackground, assertIsTrusted, assertIsBlankDocument */
 
 "use strict";
 
 this.slides = (function() {
   const exports = {};
 
   const { watchFunction } = catcher;
--- a/browser/extensions/screenshots/randomString.js
+++ b/browser/extensions/screenshots/randomString.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* exported randomString */
 
 "use strict";
 
 this.randomString = function randomString(length, chars) {
   const randomStringChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   chars = chars || randomStringChars;
   let result = "";
--- a/browser/extensions/screenshots/selector/callBackground.js
+++ b/browser/extensions/screenshots/selector/callBackground.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals log */
 
 "use strict";
 
 this.callBackground = function callBackground(funcName, ...args) {
   return browser.runtime.sendMessage({funcName, args}).then((result) => {
     if (result && result.type === "success") {
       return result.value;
--- a/browser/extensions/screenshots/selector/documentMetadata.js
+++ b/browser/extensions/screenshots/selector/documentMetadata.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.documentMetadata = (function() {
 
   function findSiteName() {
     let el = document.querySelector("meta[property~='og:site_name'][content]");
     if (el) {
       return el.getAttribute("content");
--- a/browser/extensions/screenshots/selector/shooter.js
+++ b/browser/extensions/screenshots/selector/shooter.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals global, documentMetadata, util, uicontrol, ui, catcher */
 /* globals buildSettings, domainFromUrl, randomString, shot, blobConverters */
 
 "use strict";
 
 this.shooter = (function() { // eslint-disable-line no-unused-vars
   const exports = {};
   const { AbstractShot } = shot;
--- a/browser/extensions/screenshots/selector/ui.js
+++ b/browser/extensions/screenshots/selector/ui.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals log, util, catcher, inlineSelectionCss, callBackground, assertIsTrusted, assertIsBlankDocument, buildSettings blobConverters */
 
 "use strict";
 
 this.ui = (function() { // eslint-disable-line no-unused-vars
   const exports = {};
   const SAVE_BUTTON_HEIGHT = 50;
 
--- a/browser/extensions/screenshots/selector/uicontrol.js
+++ b/browser/extensions/screenshots/selector/uicontrol.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals log, catcher, util, ui, slides */
 /* globals shooter, callBackground, selectorLoader, assertIsTrusted, buildSettings, selection */
 
 "use strict";
 
 this.uicontrol = (function() {
   const exports = {};
 
--- a/browser/extensions/screenshots/selector/util.js
+++ b/browser/extensions/screenshots/selector/util.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 this.util = (function() { // eslint-disable-line no-unused-vars
   const exports = {};
 
   /** Removes a node from its document, if it's a node and the node is attached to a parent */
   exports.removeNode = function(el) {
     if (el && el.parentNode) {
--- a/browser/extensions/screenshots/sitehelper.js
+++ b/browser/extensions/screenshots/sitehelper.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /* globals catcher, callBackground, content */
 /** This is a content script added to all screenshots.firefox.com pages, and allows the site to
     communicate with the add-on */
 
 "use strict";
 
 this.sitehelper = (function() {
 
--- a/browser/extensions/webcompat/aboutCompat.html
+++ b/browser/extensions/webcompat/aboutCompat.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE HTML>
 <html>
 <head>
   <base/>
   <!-- If you change this script tag you must update the hash in the extension's
          `content_security_policy` 'sha256-HbSjs39Y0thRGfO3RHrNzLPKyC/tq6FdIuP3jEBAcJQ=' -->
   <script>document.head.firstElementChild.href = browser.runtime.getURL("");</script>
   <meta charset="utf-8" />
--- a/browser/extensions/webcompat/injections.js
+++ b/browser/extensions/webcompat/injections.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /**
  * For detailed information on our policies, and a documention on this format
  * and its possibilites, please check the Mozilla-Wiki at
  *
  * https://wiki.mozilla.org/Compatibility/Go_Faster_Addon/Override_Policies_and_Workflows#User_Agent_overrides
  */
 
 "use strict";
--- a/browser/extensions/webcompat/injections/js/bug0000000-dummy-js-injection.js
+++ b/browser/extensions/webcompat/injections/js/bug0000000-dummy-js-injection.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /* globals exportFunction */
 
 Object.defineProperty(window.wrappedJSObject, "isTestFeatureSupported", {
   get: exportFunction(function() {
     return true;
   }, window),
--- a/browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js
+++ b/browser/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * Bug 1452707 - Build site patch for ib.absa.co.za
  * WebCompat issue #16401 - https://webcompat.com/issues/16401
  *
  * The online banking at ib.absa.co.za detect if window.controllers is a
  * non-falsy value to detect if the current browser is Firefox or something
--- a/browser/extensions/webcompat/injections/js/bug1457335-histography.io-ua-change.js
+++ b/browser/extensions/webcompat/injections/js/bug1457335-histography.io-ua-change.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * Bug 1457335 - histography.io - Override UA & navigator.vendor
  * WebCompat issue #1804 - https://webcompat.com/issues/1804
  *
  * This site is using a strict matching of navigator.userAgent and
  * navigator.vendor to allow access for Safari or Chrome. Here, we set the
--- a/browser/extensions/webcompat/injections/js/bug1472075-bankofamerica.com-ua-change.js
+++ b/browser/extensions/webcompat/injections/js/bug1472075-bankofamerica.com-ua-change.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * Bug 1472075 - Build UA override for Bank of America for OSX & Linux
  * WebCompat issue #2787 - https://webcompat.com/issues/2787
  *
  * BoA is showing a red warning to Linux and macOS users, while accepting
  * Windows users without warning. From our side, there is no difference here
--- a/browser/extensions/webcompat/injections/js/bug1472081-election.gov.np-window.sidebar-shim.js
+++ b/browser/extensions/webcompat/injections/js/bug1472081-election.gov.np-window.sidebar-shim.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * Bug 1472081 - election.gov.np - Override window.sidebar with something falsey
  * WebCompat issue #11622 - https://webcompat.com/issues/11622
  *
  * This site is blocking onmousedown and onclick if window.sidebar is something
  * that evaluates to true, rendering the form fields unusable. This patch
--- a/browser/extensions/webcompat/injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js
+++ b/browser/extensions/webcompat/injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 /**
  * portalminasnet.com - Override window.sidebar with something falsey
  * WebCompat issue #18143 - https://webcompat.com/issues/18143
  *
  * This site is blocking onmousedown and onclick if window.sidebar is something
  * that evaluates to true, rendering the login unusable. This patch overrides
--- a/browser/extensions/webcompat/ua_overrides.js
+++ b/browser/extensions/webcompat/ua_overrides.js
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 /**
  * For detailed information on our policies, and a documention on this format
  * and its possibilites, please check the Mozilla-Wiki at
  *
  * https://wiki.mozilla.org/Compatibility/Go_Faster_Addon/Override_Policies_and_Workflows#User_Agent_overrides
  */
 
 "use strict";
@@ -24,16 +28,36 @@ for (const override of [
           UAHelpers.getPrefix(originalUA) +
           " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
         );
       },
     },
   },
   {
     /*
+     * Bug 1563839 - rolb.santanderbank.com - Build UA override
+     * WebCompat issue #33462 - https://webcompat.com/issues/33462
+     *
+     * santanderbank expects UA to have 'like Gecko', otherwise it runs
+     * xmlDoc.onload whose support has been dropped. It results in missing labels in forms
+     * and some other issues.  Adding 'like Gecko' fixes those issues.
+     */
+    id: "bug1563839",
+    platform: "all",
+    domain: "rolb.santanderbank.com",
+    bug: "1563839",
+    config: {
+      matches: ["*://rolb.santanderbank.com/*"],
+      uaTransformer: originalUA => {
+        return originalUA.replace("Gecko", "like Gecko");
+      },
+    },
+  },
+  {
+    /*
      * Bug 1480710 - m.imgur.com - Build UA override
      * WebCompat issue #13154 - https://webcompat.com/issues/13154
      *
      * imgur returns a 404 for requests to CSS and JS file if requested with a Fennec
      * User Agent. By removing the Fennec identifies and adding Chrome Mobile's, we
      * receive the correct CSS and JS files.
      */
     id: "bug1480710",
--- a/browser/modules/PermissionUI.jsm
+++ b/browser/modules/PermissionUI.jsm
@@ -1190,17 +1190,17 @@ StorageAccessPermissionPrompt.prototype 
 
   get anchorID() {
     return "storage-access-notification-icon";
   },
 
   get message() {
     return gBrowserBundle.formatStringFromName("storageAccess.message", [
       "<>",
-      "<>",
+      "{}",
     ]);
   },
 
   get promptActions() {
     let self = this;
 
     let storageAccessHistogram = Services.telemetry.getHistogramById(
       "STORAGE_ACCESS_API_UI"
--- a/browser/modules/SiteDataManager.jsm
+++ b/browser/modules/SiteDataManager.jsm
@@ -1,8 +1,12 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 "use strict";
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var EXPORTED_SYMBOLS = ["SiteDataManager"];
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/mixed.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/mixed.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE HTML>
 <html>
   <head>
     <meta charset="utf8">
     <title>Mixed Content test</title>
   </head>
   <body>
     <iframe style="visibility:hidden" src="http://example.com"></iframe>
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/mixed_active.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/mixed_active.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE HTML>
 <html>
   <head>
     <meta charset="utf8">
     <title>Mixed Active Content test</title>
   </head>
   <body>
     <iframe style="visibility:hidden" src="http://example.com"></iframe>
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/mixed_passive.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/mixed_passive.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE HTML>
 <html>
   <head>
     <meta charset="utf8">
     <title>Mixed Passive Content test</title>
   </head>
   <body>
     <img style="visibility:hidden" src="http://example.com/tests/image/test/mochitest/blue.png"></img>
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/password.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/password.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE HTML>
 <html>
   <head>
     <meta charset="utf8">
     <title>HTTP Password test</title>
   </head>
   <body>
     <form>
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/tracking.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/controlCenter/tracking.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE HTML>
 <html>
   <head>
     <meta charset="utf8">
     <title>Tracking test</title>
   </head>
   <body>
     <iframe style="visibility:hidden" src="http://tracking.example.com/"></iframe>
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/lib/permissionPrompts.html
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/lib/permissionPrompts.html
@@ -1,8 +1,12 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+   - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
 <!DOCTYPE html>
 <html>
 <head>
   <meta charset="utf-8">
   <title>Permission Prompts</title>
 </head>
 <body>
   <button id="geo" onclick="navigator.geolocation.getCurrentPosition(() => {})">Geolocation</button>
--- a/caps/DomainPolicy.cpp
+++ b/caps/DomainPolicy.cpp
@@ -115,18 +115,17 @@ DomainPolicy::Deactivate() {
 void DomainPolicy::CloneDomainPolicy(DomainPolicyClone* aClone) {
   aClone->active() = true;
   mBlocklist->CloneSet(&aClone->blocklist());
   mSuperBlocklist->CloneSet(&aClone->superBlocklist());
   mAllowlist->CloneSet(&aClone->allowlist());
   mSuperAllowlist->CloneSet(&aClone->superAllowlist());
 }
 
-static void CopyURIs(const InfallibleTArray<URIParams>& aDomains,
-                     nsIDomainSet* aSet) {
+static void CopyURIs(const nsTArray<URIParams>& aDomains, nsIDomainSet* aSet) {
   for (uint32_t i = 0; i < aDomains.Length(); i++) {
     nsCOMPtr<nsIURI> uri = DeserializeURI(aDomains[i]);
     aSet->Add(uri);
   }
 }
 
 void DomainPolicy::ApplyClone(const DomainPolicyClone* aClone) {
   CopyURIs(aClone->blocklist(), mBlocklist);
@@ -210,17 +209,17 @@ DomainSet::ContainsSuperDomain(nsIURI* a
     rv = NS_MutateURI(clone).SetHost(domain).Finalize(clone);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // No match.
   return NS_OK;
 }
 
-void DomainSet::CloneSet(InfallibleTArray<URIParams>* aDomains) {
+void DomainSet::CloneSet(nsTArray<URIParams>* aDomains) {
   for (auto iter = mHashTable.Iter(); !iter.Done(); iter.Next()) {
     nsIURI* key = iter.Get()->GetKey();
 
     URIParams uri;
     SerializeURI(key, uri);
 
     aDomains->AppendElement(uri);
   }
--- a/caps/DomainPolicy.h
+++ b/caps/DomainPolicy.h
@@ -35,17 +35,17 @@ enum DomainSetType {
 
 class DomainSet final : public nsIDomainSet {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMAINSET
 
   explicit DomainSet(DomainSetType aType) : mType(aType) {}
 
-  void CloneSet(InfallibleTArray<mozilla::ipc::URIParams>* aDomains);
+  void CloneSet(nsTArray<mozilla::ipc::URIParams>* aDomains);
 
  protected:
   virtual ~DomainSet() {}
   nsTHashtable<nsURIHashKey> mHashTable;
   DomainSetType mType;
 };
 
 class DomainPolicy final : public nsIDomainPolicy {
--- a/chrome/nsChromeRegistryChrome.cpp
+++ b/chrome/nsChromeRegistryChrome.cpp
@@ -233,19 +233,19 @@ nsChromeRegistryChrome::CheckForNewChrom
 static void SerializeURI(nsIURI* aURI, SerializedURI& aSerializedURI) {
   if (!aURI) return;
 
   aURI->GetSpec(aSerializedURI.spec);
 }
 
 void nsChromeRegistryChrome::SendRegisteredChrome(
     mozilla::dom::PContentParent* aParent) {
-  InfallibleTArray<ChromePackage> packages;
-  InfallibleTArray<SubstitutionMapping> resources;
-  InfallibleTArray<OverrideMapping> overrides;
+  nsTArray<ChromePackage> packages;
+  nsTArray<SubstitutionMapping> resources;
+  nsTArray<OverrideMapping> overrides;
 
   for (auto iter = mPackagesHash.Iter(); !iter.Done(); iter.Next()) {
     ChromePackage chromePackage;
     ChromePackageFromPackageEntry(iter.Key(), iter.UserData(), &chromePackage,
                                   SKIN);
     packages.AppendElement(chromePackage);
   }
 
--- a/chrome/nsChromeRegistryContent.cpp
+++ b/chrome/nsChromeRegistryContent.cpp
@@ -8,20 +8,20 @@
 #include "nsChromeRegistryContent.h"
 #include "nsString.h"
 #include "nsNetUtil.h"
 #include "nsIResProtocolHandler.h"
 
 nsChromeRegistryContent::nsChromeRegistryContent() {}
 
 void nsChromeRegistryContent::RegisterRemoteChrome(
-    const InfallibleTArray<ChromePackage>& aPackages,
-    const InfallibleTArray<SubstitutionMapping>& aSubstitutions,
-    const InfallibleTArray<OverrideMapping>& aOverrides,
-    const nsACString& aLocale, bool aReset) {
+    const nsTArray<ChromePackage>& aPackages,
+    const nsTArray<SubstitutionMapping>& aSubstitutions,
+    const nsTArray<OverrideMapping>& aOverrides, const nsACString& aLocale,
+    bool aReset) {
   MOZ_ASSERT(aReset || mLocale.IsEmpty(), "RegisterChrome twice?");
 
   if (aReset) {
     mPackagesHash.Clear();
     mOverrideTable.Clear();
     // XXX Can't clear resources.
   }
 
--- a/chrome/nsChromeRegistryContent.h
+++ b/chrome/nsChromeRegistryContent.h
@@ -12,21 +12,20 @@
 struct ChromePackage;
 struct SubstitutionMapping;
 struct OverrideMapping;
 
 class nsChromeRegistryContent : public nsChromeRegistry {
  public:
   nsChromeRegistryContent();
 
-  void RegisterRemoteChrome(
-      const InfallibleTArray<ChromePackage>& aPackages,
-      const InfallibleTArray<SubstitutionMapping>& aResources,
-      const InfallibleTArray<OverrideMapping>& aOverrides,
-      const nsACString& aLocale, bool aReset);
+  void RegisterRemoteChrome(const nsTArray<ChromePackage>& aPackages,
+                            const nsTArray<SubstitutionMapping>& aResources,
+                            const nsTArray<OverrideMapping>& aOverrides,
+                            const nsACString& aLocale, bool aReset);
 
   NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
                                   nsIUTF8StringEnumerator** aResult) override;
   NS_IMETHOD CheckForNewChrome() override;
   NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
                      const char16_t* aData) override;
   NS_IMETHOD IsLocaleRTL(const nsACString& package, bool* aResult) override;
   NS_IMETHOD GetSelectedLocale(const nsACString& aPackage, bool aAsBCP47,
--- a/config/check_spidermonkey_style.py
+++ b/config/check_spidermonkey_style.py
@@ -97,16 +97,17 @@ included_inclnames_to_ignore = set([
     'unicode/udatpg.h',         # ICU
     'unicode/udisplaycontext.h',  # ICU
     'unicode/uenum.h',          # ICU
     'unicode/uformattedvalue.h',  # ICU
     'unicode/uloc.h',           # ICU
     'unicode/unistr.h',         # ICU
     'unicode/unorm2.h',         # ICU
     'unicode/unum.h',           # ICU
+    'unicode/unumberformatter.h',  # ICU
     'unicode/unumsys.h',        # ICU
     'unicode/upluralrules.h',   # ICU
     'unicode/ureldatefmt.h',    # ICU
     'unicode/ustring.h',        # ICU
     'unicode/utypes.h',         # ICU
     'unicode/uversion.h',       # ICU
     'vtune/VTuneWrapper.h',     # VTune
     'zydis/ZydisAPI.h',         # Zydis
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -293,19 +293,19 @@ else
 force-cargo-host-library-check:
 	@true
 endif # HOST_RUST_LIBRARY_FILE
 
 ifdef RUST_PROGRAMS
 
 GARBAGE_DIRS += $(RUST_TARGET)
 
-force-cargo-program-build:
+force-cargo-program-build: $(RESFILE)
 	$(REPORT_BUILD)
-	$(call CARGO_BUILD) $(addprefix --bin ,$(RUST_CARGO_PROGRAMS)) $(cargo_target_flag)
+	$(call CARGO_BUILD) $(addprefix --bin ,$(RUST_CARGO_PROGRAMS)) $(cargo_target_flag) -- $(if $(RESFILE),-C link-arg=$(CURDIR)/$(RESFILE))
 
 $(RUST_PROGRAMS): force-cargo-program-build
 
 force-cargo-program-check:
 	$(call CARGO_CHECK) $(addprefix --bin ,$(RUST_CARGO_PROGRAMS)) $(cargo_target_flag)
 else
 force-cargo-program-check:
 	@true
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1329,16 +1329,17 @@ if CONFIG['MOZ_SYSTEM_ICU']:
         'unicode/udat.h',
         'unicode/udatpg.h',
         'unicode/udisplaycontext.h',
         'unicode/uenum.h',
         'unicode/uformattedvalue.h',
         'unicode/unistr.h',
         'unicode/unorm.h',
         'unicode/unum.h',
+        'unicode/unumberformatter.h',
         'unicode/upluralrules.h',
         'unicode/ureldatefmt.h',
         'unicode/ustring.h',
         'unicode/utypes.h',
     ]
 
 if CONFIG['MOZ_WAYLAND']:
     system_headers += [
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -69,17 +69,17 @@ struct AnimationProperty {
   // the animation remains on the layer after the restyle.
   //
   // **NOTE**: This member is not included when comparing AnimationProperty
   // objects for equality.
   bool mIsRunningOnCompositor = false;
 
   Maybe<AnimationPerformanceWarning> mPerformanceWarning;
 
-  InfallibleTArray<AnimationPropertySegment> mSegments;
+  nsTArray<AnimationPropertySegment> mSegments;
 
   // The copy constructor/assignment doesn't copy mIsRunningOnCompositor and
   // mPerformanceWarning.
   AnimationProperty() = default;
   AnimationProperty(const AnimationProperty& aOther)
       : mProperty(aOther.mProperty), mSegments(aOther.mSegments) {}
   AnimationProperty& operator=(const AnimationProperty& aOther) {
     mProperty = aOther.mProperty;
@@ -235,19 +235,17 @@ class KeyframeEffect : public AnimationE
   //
   // NOTE(2): This function does NOT check that animations are permitted on
   // |aFrame|. It is the responsibility of the caller to first call
   // EffectCompositor::AllowCompositorAnimationsOnFrame for |aFrame|, or use
   // nsLayoutUtils::GetAnimationPropertiesForCompositor instead.
   nsCSSPropertyIDSet GetPropertiesForCompositor(EffectSet& aEffects,
                                                 const nsIFrame* aFrame) const;
 
-  const InfallibleTArray<AnimationProperty>& Properties() const {
-    return mProperties;
-  }
+  const nsTArray<AnimationProperty>& Properties() const { return mProperties; }
 
   // Update |mProperties| by recalculating from |mKeyframes| using
   // |aComputedStyle| to resolve specified values.
   void UpdateProperties(const ComputedStyle* aComputedValues);
 
   // Update various bits of state related to running ComposeStyle().
   // We need to update this outside ComposeStyle() because we should avoid
   // mutating any state in ComposeStyle() since it might be called during
--- a/dom/base/crashtests/crashtests.list
+++ b/dom/base/crashtests/crashtests.list
@@ -2,17 +2,17 @@ load 43040-1.html
 load 90613-1.html
 load 116848-1.html
 load 149320-1.html
 load 205225-1.html
 load 231475-1.html
 load 244933-1.html
 load 275912-1.html
 load 293388-1.html
-load 308120-1.xul
+load chrome://reftest/content/crashtests/dom/base/crashtests/308120-1.xul
 load 325730-1.html
 load 326618-1.html
 load 326646-1.html
 load 326865-1.html
 load 327571-1.html
 load 327694.html
 load 327695-1.html
 load 329481-1.xhtml
@@ -48,17 +48,17 @@ load 384663-1.html
 load 386000-1.html
 load 386794-1.html
 load 387460-1.html
 load 395469-1.xhtml
 load 395469-2.xhtml
 load 399712-1.html
 load 400763-1.html
 load 401993-1.html
-load 404869-1.xul
+load chrome://reftest/content/crashtests/dom/base/crashtests/404869-1.xul
 load 407818.html
 load 410860-1.xml
 load 411882-1.xhtml
 load 416734-1.html
 load 417852-1.html
 load 418928-1.html
 load 420620-1.html
 load 424276-1.html
@@ -204,19 +204,19 @@ load 1304437.html
 load 1324209.html
 load 1324463.html
 load 1324500.html
 load 1326194-1.html
 load 1326194-2.html
 load 1332939.html
 load 1341693.html
 load 1352453.html
-load 1353529.xul
+load chrome://reftest/content/crashtests/dom/base/crashtests/1353529.xul
 load 1368327.html
-load 1369363.xul
+load chrome://reftest/content/crashtests/dom/base/crashtests/1369363.xul
 load 1370072.html
 pref(clipboard.autocopy,true) load 1370737.html
 load 1370968.html
 load 1373750.html
 load 1377826.html
 load 1383478.html
 load 1383780.html
 pref(clipboard.autocopy,true) load 1385272-1.html
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -1021,17 +1021,17 @@ void RemotePermissionRequest::DoCancel()
 void RemotePermissionRequest::DoAllow(JS::HandleValue aChoices) {
   NS_ASSERTION(mRequest, "We need a request");
   nsCOMPtr<nsIContentPermissionRequest> request(mRequest);
   request->Allow(aChoices);
 }
 
 // PContentPermissionRequestChild
 mozilla::ipc::IPCResult RemotePermissionRequest::RecvNotifyResult(
-    const bool& aAllow, InfallibleTArray<PermissionChoice>&& aChoices) {
+    const bool& aAllow, nsTArray<PermissionChoice>&& aChoices) {
   Destroy();
 
   if (aAllow && mWindow->IsCurrentInnerWindow()) {
     // Use 'undefined' if no choice is provided.
     if (aChoices.IsEmpty()) {
       DoAllow(JS::UndefinedHandleValue);
       return IPC_OK();
     }
--- a/dom/base/nsContentPermissionHelper.h
+++ b/dom/base/nsContentPermissionHelper.h
@@ -227,17 +227,17 @@ class RemotePermissionRequest final
 
   RemotePermissionRequest(nsIContentPermissionRequest* aRequest,
                           nsPIDOMWindowInner* aWindow);
 
   // It will be called when prompt dismissed.  MOZ_CAN_RUN_SCRIPT_BOUNDARY
   // because we don't have MOZ_CAN_RUN_SCRIPT bits in IPC code yet.
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   mozilla::ipc::IPCResult RecvNotifyResult(
-      const bool& aAllow, InfallibleTArray<PermissionChoice>&& aChoices);
+      const bool& aAllow, nsTArray<PermissionChoice>&& aChoices);
 
   mozilla::ipc::IPCResult RecvGetVisibility();
 
   void IPDLAddRef() {
     mIPCOpen = true;
     AddRef();
   }
 
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -84,18 +84,16 @@
 #include "mozilla/dom/ChromeMessageSender.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/FrameCrashedEvent.h"
 #include "mozilla/dom/FrameLoaderBinding.h"
 #include "mozilla/dom/MozFrameLoaderOwnerBinding.h"
 #include "mozilla/dom/SessionStoreListener.h"
 #include "mozilla/gfx/CrossProcessPaint.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
-#include "mozilla/ServoCSSParser.h"
-#include "mozilla/ServoStyleSet.h"
 #include "nsGenericHTMLFrameElement.h"
 #include "GeckoProfiler.h"
 
 #include "jsapi.h"
 #include "mozilla/dom/HTMLIFrameElement.h"
 #include "nsSandboxFlags.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/dom/CustomEvent.h"
@@ -2913,17 +2911,17 @@ nsresult nsFrameLoader::DoSendAsyncMessa
   auto* browserParent = GetBrowserParent();
   if (browserParent) {
     ClonedMessageData data;
     ContentParent* cp = browserParent->Manager();
     if (!BuildClonedMessageDataForParent(cp, aData, data)) {
       MOZ_CRASH();
       return NS_ERROR_DOM_DATA_CLONE_ERR;
     }
-    InfallibleTArray<mozilla::jsipc::CpowEntry> cpows;
+    nsTArray<mozilla::jsipc::CpowEntry> cpows;
     jsipc::CPOWManager* mgr = cp->GetCPOWManager();
     if (aCpows && (!mgr || !mgr->Wrap(aCx, aCpows, &cpows))) {
       return NS_ERROR_UNEXPECTED;
     }
     if (browserParent->SendAsyncMessage(nsString(aMessage), cpows,
                                         IPC::Principal(aPrincipal), data)) {
       return NS_OK;
     } else {
@@ -3214,64 +3212,16 @@ void nsFrameLoader::Print(uint64_t aOute
   nsresult rv = webBrowserPrint->Print(aPrintSettings, aProgressListener);
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return;
   }
 #endif
 }
 
-already_AddRefed<mozilla::dom::Promise> nsFrameLoader::DrawSnapshot(
-    double aX, double aY, double aW, double aH, double aScale,
-    const nsAString& aBackgroundColor, mozilla::ErrorResult& aRv) {
-  MOZ_ASSERT(XRE_IsParentProcess());
-  if (!XRE_IsParentProcess()) {
-    aRv = NS_ERROR_FAILURE;
-    return nullptr;
-  }
-
-  RefPtr<nsIGlobalObject> global = GetOwnerContent()->GetOwnerGlobal();
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  RefPtr<Document> document = GetOwnerContent()->GetOwnerDocument();
-  if (NS_WARN_IF(!document)) {
-    aRv = NS_ERROR_FAILURE;
-    return nullptr;
-  }
-  PresShell* presShell = document->GetPresShell();
-  if (NS_WARN_IF(!presShell)) {
-    aRv = NS_ERROR_FAILURE;
-    return nullptr;
-  }
-
-  nscolor color;
-  css::Loader* loader = document->CSSLoader();
-  ServoStyleSet* set = presShell->StyleSet();
-  if (NS_WARN_IF(!ServoCSSParser::ComputeColor(
-          set, NS_RGB(0, 0, 0), aBackgroundColor, &color, nullptr, loader))) {
-    aRv = NS_ERROR_FAILURE;
-    return nullptr;
-  }
-
-  gfx::IntRect rect = gfx::IntRect::RoundOut(gfx::Rect(aX, aY, aW, aH));
-
-  if (IsRemoteFrame()) {
-    gfx::CrossProcessPaint::StartRemote(GetBrowserParent()->GetTabId(), rect,
-                                        aScale, color, promise);
-  } else {
-    gfx::CrossProcessPaint::StartLocal(GetDocShell(), rect, aScale, color,
-                                       promise);
-  }
-
-  return promise.forget();
-}
-
 already_AddRefed<nsIRemoteTab> nsFrameLoader::GetRemoteTab() {
   if (!mRemoteBrowser) {
     return nullptr;
   }
   if (auto* browserHost = mRemoteBrowser->AsBrowserHost()) {
     return do_AddRef(browserHost);
   }
   return nullptr;
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -196,20 +196,16 @@ class nsFrameLoader final : public nsStu
   void RequestUpdatePosition(mozilla::ErrorResult& aRv);
 
   bool RequestTabStateFlush(uint32_t aFlushId, bool aIsFinal = false);
 
   void Print(uint64_t aOuterWindowID, nsIPrintSettings* aPrintSettings,
              nsIWebProgressListener* aProgressListener,
              mozilla::ErrorResult& aRv);
 
-  already_AddRefed<mozilla::dom::Promise> DrawSnapshot(
-      double aX, double aY, double aW, double aH, double aScale,
-      const nsAString& aBackgroundColor, mozilla::ErrorResult& aRv);
-
   void StartPersistence(uint64_t aOuterWindowID,
                         nsIWebBrowserPersistDocumentReceiver* aRecv,
                         mozilla::ErrorResult& aRv);
 
   // WebIDL getters
 
   already_AddRefed<mozilla::dom::MessageSender> GetMessageManager();
 
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -1454,17 +1454,17 @@ class ChildProcessMessageManagerCallback
     mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
     if (!cc) {
       return true;
     }
     ClonedMessageData data;
     if (!BuildClonedMessageDataForChild(cc, aData, data)) {
       return false;
     }
-    InfallibleTArray<mozilla::jsipc::CpowEntry> cpows;
+    nsTArray<mozilla::jsipc::CpowEntry> cpows;
     if (aCpows && !cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
       return false;
     }
     if (aIsSync) {
       return cc->SendSyncMessage(PromiseFlatString(aMessage), data, cpows,
                                  IPC::Principal(aPrincipal), aRetVal);
     }
     return cc->SendRpcMessage(PromiseFlatString(aMessage), data, cpows,
@@ -1478,17 +1478,17 @@ class ChildProcessMessageManagerCallback
     mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
     if (!cc) {
       return NS_OK;
     }
     ClonedMessageData data;
     if (!BuildClonedMessageDataForChild(cc, aData, data)) {
       return NS_ERROR_DOM_DATA_CLONE_ERR;
     }
-    InfallibleTArray<mozilla::jsipc::CpowEntry> cpows;
+    nsTArray<mozilla::jsipc::CpowEntry> cpows;
     if (aCpows && !cc->GetCPOWManager()->Wrap(aCx, aCpows, &cpows)) {
       return NS_ERROR_UNEXPECTED;
     }
     if (!cc->SendAsyncMessage(PromiseFlatString(aMessage), cpows,
                               IPC::Principal(aPrincipal), data)) {
       return NS_ERROR_UNEXPECTED;
     }
 
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -1906,17 +1906,17 @@ bool ConvertJSValueToByteString(JSContex
 inline bool ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
                                        nsACString& result) {
   return ConvertJSValueToByteString(cx, v, false, result);
 }
 
 template <typename T>
 void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq);
 template <typename T>
-void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
+void DoTraceSequence(JSTracer* trc, nsTArray<T>& seq);
 
 // Class used to trace sequences, with specializations for various
 // sequence types.
 template <typename T, bool isDictionary = IsBaseOf<DictionaryBase, T>::value,
           bool isTypedArray = IsBaseOf<AllTypedArraysBase, T>::value,
           bool isOwningUnion = IsBaseOf<AllOwningUnionBase, T>::value>
 class SequenceTracer {
   explicit SequenceTracer() = delete;  // Should never be instantiated
@@ -2059,17 +2059,17 @@ class SequenceTracer<Record<K, V>, false
 
 template <typename T>
 void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq) {
   SequenceTracer<T>::TraceSequence(trc, seq.Elements(),
                                    seq.Elements() + seq.Length());
 }
 
 template <typename T>
-void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq) {
+void DoTraceSequence(JSTracer* trc, nsTArray<T>& seq) {
   SequenceTracer<T>::TraceSequence(trc, seq.Elements(),
                                    seq.Elements() + seq.Length());
 }
 
 // Rooter class for sequences; this is what we mostly use in the codegen
 template <typename T>
 class MOZ_RAII SequenceRooter final : private JS::CustomAutoRooter {
  public:
@@ -2077,17 +2077,17 @@ class MOZ_RAII SequenceRooter final : pr
   SequenceRooter(const CX& cx,
                  FallibleTArray<T>* aSequence MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
         mFallibleArray(aSequence),
         mSequenceType(eFallibleArray) {}
 
   template <typename CX>
   SequenceRooter(const CX& cx,
-                 InfallibleTArray<T>* aSequence MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+                 nsTArray<T>* aSequence MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
         mInfallibleArray(aSequence),
         mSequenceType(eInfallibleArray) {}
 
   template <typename CX>
   SequenceRooter(const CX& cx, Nullable<nsTArray<T>>* aSequence
                                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
       : JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
@@ -2106,17 +2106,17 @@ class MOZ_RAII SequenceRooter final : pr
       MOZ_ASSERT(mSequenceType == eNullableArray);
       if (!mNullableArray->IsNull()) {
         DoTraceSequence(trc, mNullableArray->Value());
       }
     }
   }
 
   union {
-    InfallibleTArray<T>* mInfallibleArray;
+    nsTArray<T>* mInfallibleArray;
     FallibleTArray<T>* mFallibleArray;
     Nullable<nsTArray<T>>* mNullableArray;
   };
 
   SequenceType mSequenceType;
 };
 
 // Rooter class for Record; this is what we mostly use in the codegen.
--- a/dom/chrome-webidl/WindowGlobalActors.webidl
+++ b/dom/chrome-webidl/WindowGlobalActors.webidl
@@ -52,16 +52,35 @@ interface WindowGlobalParent {
   JSWindowActorParent getActor(DOMString name);
 
   [Throws]
   Promise<unsigned long long> changeFrameRemoteness(
     BrowsingContext? bc, DOMString remoteType,
     unsigned long long pendingSwitchId);
 
   /**
+   * Renders a region of the frame into an image bitmap.
+   *
+   * @param rect Specify the area of the window to render, in CSS pixels. This
+   * is relative to the current scroll position. If null, the entire viewport
+   * is rendered.
+   * @param scale The scale to render the window at. Use devicePixelRatio
+   * to have comparable rendering to the OS.
+   * @param backgroundColor The background color to use.
+   *
+   * This API can only be used in the parent process, as content processes
+   * cannot access the rendering of out of process iframes. This API works
+   * with remote and local frames.
+   */
+  [Throws]
+  Promise<ImageBitmap> drawSnapshot(DOMRect? rect,
+                                    double scale,
+                                    DOMString backgroundColor);
+
+  /**
    * Fetches the securityInfo object for this window. This function will
    * look for failed and successful channels to find the security info,
    * thus it will work on regular HTTPS pages as well as certificate
    * error pages.
    *
    * This returns a Promise which resolves to an nsITransportSecurity
    * object with certificate data or undefined if no security info is available.
    */
--- a/dom/crypto/CryptoBuffer.cpp
+++ b/dom/crypto/CryptoBuffer.cpp
@@ -28,17 +28,17 @@ uint8_t* CryptoBuffer::Assign(const nsAC
                 aString.Length());
 }
 
 uint8_t* CryptoBuffer::Assign(const SECItem* aItem) {
   MOZ_ASSERT(aItem);
   return Assign(aItem->data, aItem->len);
 }
 
-uint8_t* CryptoBuffer::Assign(const InfallibleTArray<uint8_t>& aData) {
+uint8_t* CryptoBuffer::Assign(const nsTArray<uint8_t>& aData) {
   return ReplaceElementsAt(0, Length(), aData.Elements(), aData.Length(),
                            fallible);
 }
 
 uint8_t* CryptoBuffer::Assign(const ArrayBuffer& aData) {
   aData.ComputeLengthAndData();
   return Assign(aData.Data(), aData.Length());
 }
--- a/dom/crypto/CryptoBuffer.h
+++ b/dom/crypto/CryptoBuffer.h
@@ -18,17 +18,17 @@ class ArrayBufferViewOrArrayBuffer;
 class OwningArrayBufferViewOrArrayBuffer;
 
 class CryptoBuffer : public FallibleTArray<uint8_t> {
  public:
   uint8_t* Assign(const CryptoBuffer& aData);
   uint8_t* Assign(const uint8_t* aData, uint32_t aLength);
   uint8_t* Assign(const nsACString& aString);
   uint8_t* Assign(const SECItem* aItem);
-  uint8_t* Assign(const InfallibleTArray<uint8_t>& aData);
+  uint8_t* Assign(const nsTArray<uint8_t>& aData);
   uint8_t* Assign(const ArrayBuffer& aData);
   uint8_t* Assign(const ArrayBufferView& aData);
   uint8_t* Assign(const ArrayBufferViewOrArrayBuffer& aData);
   uint8_t* Assign(const OwningArrayBufferViewOrArrayBuffer& aData);
 
   uint8_t* AppendSECItem(const SECItem* aItem);
   uint8_t* AppendSECItem(const SECItem& aItem);
 
--- a/dom/filesystem/PFileSystemParams.ipdlh
+++ b/dom/filesystem/PFileSystemParams.ipdlh
@@ -7,23 +7,23 @@ namespace dom {
 
 struct FileSystemGetDirectoryListingParams
 {
   nsString filesystem;
   nsString realPath;
   nsString domPath;
 
   // 'filters' could be an array rather than a semicolon separated string
-  // (we'd then use InfallibleTArray<nsString> internally), but that is
+  // (we'd then use nsTArray<nsString> internally), but that is
   // wasteful.  E10s requires us to pass the filters over as a string anyway,
   // so avoiding using an array avoids serialization on the side passing the
   // filters.  Since an nsString can share its buffer when copied,
-  // using that instead of InfallibleTArray<nsString> makes copying the filters
+  // using that instead of nsTArray<nsString> makes copying the filters
   // around in any given process a bit more efficient too, since copying a
-  // single nsString is cheaper than copying InfallibleTArray member data and
+  // single nsString is cheaper than copying nsTArray member data and
   // each nsString that it contains.
   nsString filters;
 };
 
 struct FileSystemGetFilesParams
 {
   nsString filesystem;
   nsString realPath;
--- a/dom/html/crashtests/crashtests.list
+++ b/dom/html/crashtests/crashtests.list
@@ -42,17 +42,17 @@ load 605264.html
 load 606430-1.html
 load 613027.html
 load 614279.html
 load 614988-1.html
 load 620078-1.html
 load 620078-2.html
 load 631421.html
 load 673853.html
-load 680922-1.xul
+load chrome://reftest/content/crashtests/dom/html/crashtests/680922-1.xul
 load 682058.xhtml
 load 682460.html
 load 738744.xhtml
 load 741218.json
 load 741250.xhtml
 load 768344.html
 load 795221-1.html
 load 795221-2.html
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -5876,18 +5876,17 @@ class Database final
   bool DeallocPBackgroundIDBDatabaseRequestParent(
       PBackgroundIDBDatabaseRequestParent* aActor) override;
 
   PBackgroundIDBTransactionParent* AllocPBackgroundIDBTransactionParent(
       const nsTArray<nsString>& aObjectStoreNames, const Mode& aMode) override;
 
   mozilla::ipc::IPCResult RecvPBackgroundIDBTransactionConstructor(
       PBackgroundIDBTransactionParent* aActor,
-      InfallibleTArray<nsString>&& aObjectStoreNames,
-      const Mode& aMode) override;
+      nsTArray<nsString>&& aObjectStoreNames, const Mode& aMode) override;
 
   bool DeallocPBackgroundIDBTransactionParent(
       PBackgroundIDBTransactionParent* aActor) override;
 
   PBackgroundIDBVersionChangeTransactionParent*
   AllocPBackgroundIDBVersionChangeTransactionParent(
       const uint64_t& aCurrentVersion, const uint64_t& aRequestedVersion,
       const int64_t& aNextObjectStoreId, const int64_t& aNextIndexId) override;
@@ -13002,17 +13001,17 @@ PBackgroundIDBTransactionParent* Databas
 
   MOZ_ASSERT(infallibleObjectStores.IsEmpty());
 
   return transaction.forget().take();
 }
 
 mozilla::ipc::IPCResult Database::RecvPBackgroundIDBTransactionConstructor(
     PBackgroundIDBTransactionParent* aActor,
-    InfallibleTArray<nsString>&& aObjectStoreNames, const Mode& aMode) {
+    nsTArray<nsString>&& aObjectStoreNames, const Mode& aMode) {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aActor);
   MOZ_ASSERT(!aObjectStoreNames.IsEmpty());
   MOZ_ASSERT(aMode == IDBTransaction::READ_ONLY ||
              aMode == IDBTransaction::READ_WRITE ||
              aMode == IDBTransaction::READ_WRITE_FLUSH ||
              aMode == IDBTransaction::CLEANUP);
   MOZ_ASSERT(!mClosed);
--- a/dom/ipc/BrowserChild.cpp
+++ b/dom/ipc/BrowserChild.cpp
@@ -2167,17 +2167,17 @@ mozilla::ipc::IPCResult BrowserChild::Re
     return IPC_OK();
   }
 
   LoadScriptInternal(mm, aURL, !aRunInGlobalScope);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserChild::RecvAsyncMessage(
-    const nsString& aMessage, InfallibleTArray<CpowEntry>&& aCpows,
+    const nsString& aMessage, nsTArray<CpowEntry>&& aCpows,
     nsIPrincipal* aPrincipal, const ClonedMessageData& aData) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("BrowserChild::RecvAsyncMessage",
                                              OTHER, aMessage);
   MMPrinter::Print("BrowserChild::RecvAsyncMessage", aMessage, aData);
 
   CrossProcessCpowHolder cpows(Manager(), aCpows);
   if (!mBrowserChildMessageManager) {
     return IPC_OK();
@@ -2482,44 +2482,16 @@ mozilla::ipc::IPCResult BrowserChild::Re
     }
   }
 
   UpdateVisibility(true);
 
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult BrowserChild::RecvRequestRootPaint(
-    const IntRect& aRect, const float& aScale, const nscolor& aBackgroundColor,
-    RequestRootPaintResolver&& aResolve) {
-  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
-  if (!docShell) {
-    return IPC_OK();
-  }
-
-  aResolve(
-      gfx::PaintFragment::Record(docShell, aRect, aScale, aBackgroundColor));
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult BrowserChild::RecvRequestSubPaint(
-    const float& aScale, const nscolor& aBackgroundColor,
-    RequestSubPaintResolver&& aResolve) {
-  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
-  if (!docShell) {
-    return IPC_OK();
-  }
-
-  gfx::IntRect rect = gfx::RoundedIn(gfx::Rect(
-      0.0f, 0.0f, mUnscaledInnerSize.width, mUnscaledInnerSize.height));
-  aResolve(
-      gfx::PaintFragment::Record(docShell, rect, aScale, aBackgroundColor));
-  return IPC_OK();
-}
-
 mozilla::ipc::IPCResult BrowserChild::RecvNavigateByKey(
     const bool& aForward, const bool& aForDocumentNavigation) {
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (fm) {
     RefPtr<Element> result;
     nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(WebNavigation());
 
     // Move to the first or last document.
@@ -2907,17 +2879,17 @@ void BrowserChild::SetTabId(const TabId&
 bool BrowserChild::DoSendBlockingMessage(
     JSContext* aCx, const nsAString& aMessage, StructuredCloneData& aData,
     JS::Handle<JSObject*> aCpows, nsIPrincipal* aPrincipal,
     nsTArray<StructuredCloneData>* aRetVal, bool aIsSync) {
   ClonedMessageData data;
   if (!BuildClonedMessageDataForChild(Manager(), aData, data)) {
     return false;
   }
-  InfallibleTArray<CpowEntry> cpows;
+  nsTArray<CpowEntry> cpows;
   if (aCpows) {
     jsipc::CPOWManager* mgr = Manager()->GetCPOWManager();
     if (!mgr || !mgr->Wrap(aCx, aCpows, &cpows)) {
       return false;
     }
   }
   if (aIsSync) {
     return SendSyncMessage(PromiseFlatString(aMessage), data, cpows, aPrincipal,
@@ -2932,17 +2904,17 @@ nsresult BrowserChild::DoSendAsyncMessag
                                           const nsAString& aMessage,
                                           StructuredCloneData& aData,
                                           JS::Handle<JSObject*> aCpows,
                                           nsIPrincipal* aPrincipal) {
   ClonedMessageData data;
   if (!BuildClonedMessageDataForChild(Manager(), aData, data)) {
     return NS_ERROR_DOM_DATA_CLONE_ERR;
   }
-  InfallibleTArray<CpowEntry> cpows;
+  nsTArray<CpowEntry> cpows;
   if (aCpows) {
     jsipc::CPOWManager* mgr = Manager()->GetCPOWManager();
     if (!mgr || !mgr->Wrap(aCx, aCpows, &cpows)) {
       return NS_ERROR_UNEXPECTED;
     }
   }
   if (!SendAsyncMessage(PromiseFlatString(aMessage), cpows, aPrincipal, data)) {
     return NS_ERROR_UNEXPECTED;
--- a/dom/ipc/BrowserChild.h
+++ b/dom/ipc/BrowserChild.h
@@ -386,17 +386,17 @@ class BrowserChild final : public nsMess
 
   mozilla::ipc::IPCResult RecvActivateFrameEvent(const nsString& aType,
                                                  const bool& aCapture);
 
   mozilla::ipc::IPCResult RecvLoadRemoteScript(const nsString& aURL,
                                                const bool& aRunInGlobalScope);
 
   mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMessage,
-                                           InfallibleTArray<CpowEntry>&& aCpows,
+                                           nsTArray<CpowEntry>&& aCpows,
                                            nsIPrincipal* aPrincipal,
                                            const ClonedMessageData& aData);
   mozilla::ipc::IPCResult RecvSwappedWithOtherRemoteLoader(
       const IPCTabContext& aContext);
 
   PDocAccessibleChild* AllocPDocAccessibleChild(PDocAccessibleChild*,
                                                 const uint64_t&,
                                                 const uint32_t&,
@@ -680,24 +680,16 @@ class BrowserChild final : public nsMess
 
   mozilla::ipc::IPCResult RecvSetDocShellIsActive(const bool& aIsActive);
 
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   mozilla::ipc::IPCResult RecvRenderLayers(
       const bool& aEnabled, const bool& aForce,
       const layers::LayersObserverEpoch& aEpoch);
 
-  mozilla::ipc::IPCResult RecvRequestRootPaint(
-      const IntRect& aRect, const float& aScale,
-      const nscolor& aBackgroundColor, RequestRootPaintResolver&& aResolve);
-
-  mozilla::ipc::IPCResult RecvRequestSubPaint(
-      const float& aScale, const nscolor& aBackgroundColor,
-      RequestSubPaintResolver&& aResolve);
-
   mozilla::ipc::IPCResult RecvNavigateByKey(const bool& aForward,
                                             const bool& aForDocumentNavigation);
 
   mozilla::ipc::IPCResult RecvRequestNotifyAfterRemotePaint();
 
   mozilla::ipc::IPCResult RecvSuppressDisplayport(const bool& aEnabled);
 
   mozilla::ipc::IPCResult RecvParentActivated(const bool& aActivated);
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -1825,17 +1825,17 @@ bool BrowserParent::SendHandleTap(TapTyp
                                              aModifiers, aGuid, aInputBlockId)
              : PBrowserParent::SendNormalPriorityHandleTap(
                    aType, TransformParentToChild(aPoint), aModifiers, aGuid,
                    aInputBlockId);
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvSyncMessage(
     const nsString& aMessage, const ClonedMessageData& aData,
-    InfallibleTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
+    nsTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
     nsTArray<StructuredCloneData>* aRetVal) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("BrowserParent::RecvSyncMessage",
                                              OTHER, aMessage);
   MMPrinter::Print("BrowserParent::RecvSyncMessage", aMessage, aData);
 
   StructuredCloneData data;
   ipc::UnpackClonedMessageDataForParent(aData, data);
 
@@ -1843,34 +1843,34 @@ mozilla::ipc::IPCResult BrowserParent::R
   if (!ReceiveMessage(aMessage, true, &data, &cpows, aPrincipal, aRetVal)) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvRpcMessage(
     const nsString& aMessage, const ClonedMessageData& aData,
-    InfallibleTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
+    nsTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
     nsTArray<StructuredCloneData>* aRetVal) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("BrowserParent::RecvRpcMessage",
                                              OTHER, aMessage);
   MMPrinter::Print("BrowserParent::RecvRpcMessage", aMessage, aData);
 
   StructuredCloneData data;
   ipc::UnpackClonedMessageDataForParent(aData, data);
 
   CrossProcessCpowHolder cpows(Manager(), aCpows);
   if (!ReceiveMessage(aMessage, true, &data, &cpows, aPrincipal, aRetVal)) {
     return IPC_FAIL_NO_REASON(this);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvAsyncMessage(
-    const nsString& aMessage, InfallibleTArray<CpowEntry>&& aCpows,
+    const nsString& aMessage, nsTArray<CpowEntry>&& aCpows,
     nsIPrincipal* aPrincipal, const ClonedMessageData& aData) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("BrowserParent::RecvAsyncMessage",
                                              OTHER, aMessage);
   MMPrinter::Print("BrowserParent::RecvAsyncMessage", aMessage, aData);
 
   StructuredCloneData data;
   ipc::UnpackClonedMessageDataForParent(aData, data);
 
@@ -3323,49 +3323,16 @@ void BrowserParent::LayerTreeUpdate(cons
   } else {
     event->InitEvent(NS_LITERAL_STRING("MozLayerTreeCleared"), true, false);
   }
   event->SetTrusted(true);
   event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
   mFrameElement->DispatchEvent(*event);
 }
 
-void BrowserParent::RequestRootPaint(gfx::CrossProcessPaint* aPaint,
-                                     IntRect aRect, float aScale,
-                                     nscolor aBackgroundColor) {
-  auto promise = SendRequestRootPaint(aRect, aScale, aBackgroundColor);
-
-  RefPtr<gfx::CrossProcessPaint> paint(aPaint);
-  TabId tabId(GetTabId());
-  promise->Then(
-      GetMainThreadSerialEventTarget(), __func__,
-      [paint, tabId](PaintFragment&& aFragment) {
-        paint->ReceiveFragment(tabId, std::move(aFragment));
-      },
-      [paint, tabId](ResponseRejectReason&& aReason) {
-        paint->LostFragment(tabId);
-      });
-}
-
-void BrowserParent::RequestSubPaint(gfx::CrossProcessPaint* aPaint,
-                                    float aScale, nscolor aBackgroundColor) {
-  auto promise = SendRequestSubPaint(aScale, aBackgroundColor);
-
-  RefPtr<gfx::CrossProcessPaint> paint(aPaint);
-  TabId tabId(GetTabId());
-  promise->Then(
-      GetMainThreadSerialEventTarget(), __func__,
-      [paint, tabId](PaintFragment&& aFragment) {
-        paint->ReceiveFragment(tabId, std::move(aFragment));
-      },
-      [paint, tabId](ResponseRejectReason&& aReason) {
-        paint->LostFragment(tabId);
-      });
-}
-
 mozilla::ipc::IPCResult BrowserParent::RecvPaintWhileInterruptingJSNoOp(
     const LayersObserverEpoch& aEpoch) {
   // We sent a PaintWhileInterruptingJS message when layers were already
   // visible. In this case, we should act as if an update occurred even though
   // we already have the layers.
   LayerTreeUpdate(aEpoch, true);
   return IPC_OK();
 }
@@ -3447,18 +3414,18 @@ bool BrowserParent::DeallocPPaymentReque
 
 nsresult BrowserParent::HandleEvent(Event* aEvent) {
   if (mIsDestroyed) {
     return NS_OK;
   }
 
   nsAutoString eventType;
   aEvent->GetType(eventType);
-  if (eventType.EqualsLiteral("MozUpdateWindowPos")
-      || eventType.EqualsLiteral("fullscreenchange")) {
+  if (eventType.EqualsLiteral("MozUpdateWindowPos") ||
+      eventType.EqualsLiteral("fullscreenchange")) {
     // Events that signify the window moving are used to update the position
     // and notify the BrowserChild.
     return UpdatePosition();
   }
   return NS_OK;
 }
 
 class FakeChannel final : public nsIChannel,
@@ -3703,17 +3670,17 @@ mozilla::ipc::IPCResult BrowserParent::R
   nsCOMPtr<IHistory> history = services::GetHistoryService();
   if (history) {
     Unused << history->VisitURI(widget, ourURI, ourLastVisitedURI, aFlags);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvQueryVisitedState(
-    InfallibleTArray<URIParams>&& aURIs) {
+    nsTArray<URIParams>&& aURIs) {
 #ifdef MOZ_ANDROID_HISTORY
   nsCOMPtr<IHistory> history = services::GetHistoryService();
   if (NS_WARN_IF(!history)) {
     return IPC_OK();
   }
   RefPtr<nsIWidget> widget = GetWidget();
   if (NS_WARN_IF(!widget)) {
     return IPC_OK();
--- a/dom/ipc/BrowserParent.h
+++ b/dom/ipc/BrowserParent.h
@@ -327,26 +327,26 @@ class BrowserParent final : public PBrow
 
   mozilla::ipc::IPCResult RecvBrowserFrameOpenWindow(
       PBrowserParent* aOpener, const nsString& aURL, const nsString& aName,
       bool aForceNoReferrer, const nsString& aFeatures,
       BrowserFrameOpenWindowResolver&& aResolve);
 
   mozilla::ipc::IPCResult RecvSyncMessage(
       const nsString& aMessage, const ClonedMessageData& aData,
-      InfallibleTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
+      nsTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
       nsTArray<ipc::StructuredCloneData>* aRetVal);
 
   mozilla::ipc::IPCResult RecvRpcMessage(
       const nsString& aMessage, const ClonedMessageData& aData,
-      InfallibleTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
+      nsTArray<CpowEntry>&& aCpows, nsIPrincipal* aPrincipal,
       nsTArray<ipc::StructuredCloneData>* aRetVal);
 
   mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMessage,
-                                           InfallibleTArray<CpowEntry>&& aCpows,
+                                           nsTArray<CpowEntry>&& aCpows,
                                            nsIPrincipal* aPrincipal,
                                            const ClonedMessageData& aData);
 
   mozilla::ipc::IPCResult RecvNotifyIMEFocus(
       const ContentCache& aContentCache,
       const widget::IMENotification& aEventMessage,
       NotifyIMEFocusResolver&& aResolve);
 
@@ -673,21 +673,16 @@ class BrowserParent final : public PBrow
 
   bool DeallocPPaymentRequestParent(PPaymentRequestParent* aActor);
 
   bool SendLoadRemoteScript(const nsString& aURL,
                             const bool& aRunInGlobalScope);
 
   void LayerTreeUpdate(const LayersObserverEpoch& aEpoch, bool aActive);
 
-  void RequestRootPaint(gfx::CrossProcessPaint* aPaint, IntRect aRect,
-                        float aScale, nscolor aBackgroundColor);
-  void RequestSubPaint(gfx::CrossProcessPaint* aPaint, float aScale,
-                       nscolor aBackgroundColor);
-
   mozilla::ipc::IPCResult RecvInvokeDragSession(
       nsTArray<IPCDataTransfer>&& aTransfers, const uint32_t& aAction,
       Maybe<Shmem>&& aVisualDnDData, const uint32_t& aStride,
       const gfx::SurfaceFormat& aFormat, const LayoutDeviceIntRect& aDragRect,
       nsIPrincipal* aPrincipal);
 
   void AddInitialDnDDataTo(DataTransfer* aDataTransfer,
                            nsIPrincipal** aPrincipal);
@@ -767,18 +762,17 @@ class BrowserParent final : public PBrow
 
   mozilla::ipc::IPCResult RecvSetSystemFont(const nsCString& aFontName);
   mozilla::ipc::IPCResult RecvGetSystemFont(nsCString* aFontName);
 
   mozilla::ipc::IPCResult RecvVisitURI(const URIParams& aURI,
                                        const Maybe<URIParams>& aLastVisitedURI,
                                        const uint32_t& aFlags);
 
-  mozilla::ipc::IPCResult RecvQueryVisitedState(
-      InfallibleTArray<URIParams>&& aURIs);
+  mozilla::ipc::IPCResult RecvQueryVisitedState(nsTArray<URIParams>&& aURIs);
 
   mozilla::ipc::IPCResult RecvFireFrameLoadEvent(bool aIsTrusted);
 
  private:
   void SuppressDisplayport(bool aEnabled);
 
   void DestroyInternal();
 
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1869,18 +1869,17 @@ mozilla::ipc::IPCResult ContentChild::Re
     os->NotifyObservers(static_cast<nsIBrowserChild*>(browserChild),
                         "tab-child-created", nullptr);
   }
   // Notify parent that we are ready to handle input events.
   browserChild->SendRemoteIsReadyToHandleInputEvents();
   return IPC_OK();
 }
 
-void ContentChild::GetAvailableDictionaries(
-    InfallibleTArray<nsString>& aDictionaries) {
+void ContentChild::GetAvailableDictionaries(nsTArray<nsString>& aDictionaries) {
   aDictionaries = mAvailableDictionaries;
 }
 
 PFileDescriptorSetChild* ContentChild::SendPFileDescriptorSetConstructor(
     const FileDescriptor& aFD) {
   if (IsShuttingDown()) {
     return nullptr;
   }
@@ -2267,19 +2266,19 @@ bool ContentChild::DeallocPWebrtcGlobalC
   delete static_cast<WebrtcGlobalChild*>(aActor);
   return true;
 #else
   return false;
 #endif
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvRegisterChrome(
-    InfallibleTArray<ChromePackage>&& packages,
-    InfallibleTArray<SubstitutionMapping>&& resources,
-    InfallibleTArray<OverrideMapping>&& overrides, const nsCString& locale,
+    nsTArray<ChromePackage>&& packages,
+    nsTArray<SubstitutionMapping>&& resources,
+    nsTArray<OverrideMapping>&& overrides, const nsCString& locale,
     const bool& reset) {
   nsCOMPtr<nsIChromeRegistry> registrySvc = nsChromeRegistry::GetService();
   nsChromeRegistryContent* chromeRegistry =
       static_cast<nsChromeRegistryContent*>(registrySvc.get());
   if (!chromeRegistry) {
     return IPC_FAIL(this, "ChromeRegistryContent is null!");
   }
   chromeRegistry->RegisterRemoteChrome(packages, resources, overrides, locale,
@@ -2524,17 +2523,17 @@ mozilla::ipc::IPCResult ContentChild::Re
 mozilla::ipc::IPCResult ContentChild::RecvLoadProcessScript(
     const nsString& aURL) {
   auto* global = ContentProcessMessageManager::Get();
   global->LoadScript(aURL);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvAsyncMessage(
-    const nsString& aMsg, InfallibleTArray<CpowEntry>&& aCpows,
+    const nsString& aMsg, nsTArray<CpowEntry>&& aCpows,
     const IPC::Principal& aPrincipal, const ClonedMessageData& aData) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("ContentChild::RecvAsyncMessage",
                                              OTHER, aMsg);
   MMPrinter::Print("ContentChild::RecvAsyncMessage", aMsg, aData);
 
   CrossProcessCpowHolder cpows(this, aCpows);
   RefPtr<nsFrameMessageManager> cpm =
       nsFrameMessageManager::GetChildProcessManager();
@@ -2604,24 +2603,24 @@ mozilla::ipc::IPCResult ContentChild::Re
   if (!gs) {
     return IPC_OK();
   }
   gs->NotifyError(errorCode);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvUpdateDictionaryList(
-    InfallibleTArray<nsString>&& aDictionaries) {
+    nsTArray<nsString>&& aDictionaries) {
   mAvailableDictionaries = aDictionaries;
   mozInlineSpellChecker::UpdateCanEnableInlineSpellChecking();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvUpdateFontList(
-    InfallibleTArray<SystemFontListEntry>&& aFontList) {
+    nsTArray<SystemFontListEntry>&& aFontList) {
   mFontList = std::move(aFontList);
   gfxPlatform::GetPlatform()->UpdateFontList();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvRebuildFontList() {
   gfxPlatform::GetPlatform()->UpdateFontList();
   return IPC_OK();
@@ -3141,17 +3140,17 @@ mozilla::ipc::IPCResult ContentChild::Re
       false,
       "ContentChild::RecvUpdateWindow calls unexpected on this platform.");
   return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 PContentPermissionRequestChild*
 ContentChild::AllocPContentPermissionRequestChild(
-    const InfallibleTArray<PermissionRequest>& aRequests,
+    const nsTArray<PermissionRequest>& aRequests,
     const IPC::Principal& aPrincipal, const IPC::Principal& aTopLevelPrincipal,
     const bool& aIsHandlingUserInput, const bool& aDocumentHasUserInput,
     const DOMTimeStamp aPageLoadTimestamp, const TabId& aTabId) {
   MOZ_CRASH("unused");
   return nullptr;
 }
 
 bool ContentChild::DeallocPContentPermissionRequestChild(
@@ -3340,17 +3339,17 @@ mozilla::ipc::IPCResult ContentChild::Re
                                                const nsString& aMessageId) {
   PushMessageDispatcher dispatcher(aScope, aPrincipal, aMessageId, Nothing());
   Unused << NS_WARN_IF(NS_FAILED(dispatcher.NotifyObserversAndWorkers()));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvPushWithData(
     const nsCString& aScope, const IPC::Principal& aPrincipal,
-    const nsString& aMessageId, InfallibleTArray<uint8_t>&& aData) {
+    const nsString& aMessageId, nsTArray<uint8_t>&& aData) {
   PushMessageDispatcher dispatcher(aScope, aPrincipal, aMessageId, Some(aData));
   Unused << NS_WARN_IF(NS_FAILED(dispatcher.NotifyObserversAndWorkers()));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvPushSubscriptionChange(
     const nsCString& aScope, const IPC::Principal& aPrincipal) {
   PushSubscriptionChangeDispatcher dispatcher(aScope, aPrincipal);
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -301,19 +301,19 @@ class ContentChild final : public PConte
 
   mozilla::ipc::IPCResult RecvNotifyEmptyHTTPCache();
 
   PSpeechSynthesisChild* AllocPSpeechSynthesisChild();
 
   bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor);
 
   mozilla::ipc::IPCResult RecvRegisterChrome(
-      InfallibleTArray<ChromePackage>&& packages,
-      InfallibleTArray<SubstitutionMapping>&& resources,
-      InfallibleTArray<OverrideMapping>&& overrides, const nsCString& locale,
+      nsTArray<ChromePackage>&& packages,
+      nsTArray<SubstitutionMapping>&& resources,
+      nsTArray<OverrideMapping>&& overrides, const nsCString& locale,
       const bool& reset);
   mozilla::ipc::IPCResult RecvRegisterChromeItem(
       const ChromeRegistryItem& item);
 
   mozilla::ipc::IPCResult RecvClearImageCache(const bool& privateLoader,
                                               const bool& chrome);
 
   mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild();
@@ -357,17 +357,17 @@ class ContentChild final : public PConte
   mozilla::ipc::IPCResult RecvDataStorageClear(const nsString& aFilename);
 
   mozilla::ipc::IPCResult RecvNotifyAlertsObserver(const nsCString& aType,
                                                    const nsString& aData);
 
   mozilla::ipc::IPCResult RecvLoadProcessScript(const nsString& aURL);
 
   mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMsg,
-                                           InfallibleTArray<CpowEntry>&& aCpows,
+                                           nsTArray<CpowEntry>&& aCpows,
                                            const IPC::Principal& aPrincipal,
                                            const ClonedMessageData& aData);
 
   mozilla::ipc::IPCResult RecvRegisterStringBundles(
       nsTArray<StringBundleDescriptor>&& stringBundles);
 
   mozilla::ipc::IPCResult RecvUpdateSharedData(
       const FileDescriptor& aMapFile, const uint32_t& aMapSize,
@@ -378,20 +378,20 @@ class ContentChild final : public PConte
   mozilla::ipc::IPCResult RecvGeolocationUpdate(nsIDOMGeoPosition* aPosition);
 
   // MOZ_CAN_RUN_SCRIPT_BOUNDARY because we don't have MOZ_CAN_RUN_SCRIPT bits
   // in IPC code yet.
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   mozilla::ipc::IPCResult RecvGeolocationError(const uint16_t& errorCode);
 
   mozilla::ipc::IPCResult RecvUpdateDictionaryList(
-      InfallibleTArray<nsString>&& aDictionaries);
+      nsTArray<nsString>&& aDictionaries);
 
   mozilla::ipc::IPCResult RecvUpdateFontList(
-      InfallibleTArray<SystemFontListEntry>&& aFontList);
+      nsTArray<SystemFontListEntry>&& aFontList);
   mozilla::ipc::IPCResult RecvRebuildFontList();
 
   mozilla::ipc::IPCResult RecvUpdateAppLocales(
       nsTArray<nsCString>&& aAppLocales);
   mozilla::ipc::IPCResult RecvUpdateRequestedLocales(
       nsTArray<nsCString>&& aRequestedLocales);
 
   mozilla::ipc::IPCResult RecvAddPermission(const IPC::Permission& permission);
@@ -470,17 +470,17 @@ class ContentChild final : public PConte
 
   mozilla::ipc::IPCResult RecvPush(const nsCString& aScope,
                                    const IPC::Principal& aPrincipal,
                                    const nsString& aMessageId);
 
   mozilla::ipc::IPCResult RecvPushWithData(const nsCString& aScope,
                                            const IPC::Principal& aPrincipal,
                                            const nsString& aMessageId,
-                                           InfallibleTArray<uint8_t>&& aData);
+                                           nsTArray<uint8_t>&& aData);
 
   mozilla::ipc::IPCResult RecvPushSubscriptionChange(
       const nsCString& aScope, const IPC::Principal& aPrincipal);
 
   mozilla::ipc::IPCResult RecvPushError(const nsCString& aScope,
                                         const IPC::Principal& aPrincipal,
                                         const nsString& aMessage,
                                         const uint32_t& aFlags);
@@ -523,33 +523,33 @@ class ContentChild final : public PConte
       ManagedEndpoint<PBrowserChild>&& aBrowserEp, const TabId& aTabId,
       const TabId& aSameTabGroupAs, const IPCTabContext& aContext,
       BrowsingContext* aBrowsingContext, const uint32_t& aChromeFlags,
       const ContentParentId& aCpID, const bool& aIsForBrowser,
       const bool& aIsTopLevel);
 
   FORWARD_SHMEM_ALLOCATOR_TO(PContentChild)
 
-  void GetAvailableDictionaries(InfallibleTArray<nsString>& aDictionaries);
+  void GetAvailableDictionaries(nsTArray<nsString>& aDictionaries);
 
   PBrowserOrId GetBrowserOrId(BrowserChild* aBrowserChild);
 
   POfflineCacheUpdateChild* AllocPOfflineCacheUpdateChild(
       const URIParams& manifestURI, const URIParams& documentURI,
       const PrincipalInfo& aLoadingPrincipalInfo, const bool& stickDocument);
 
   bool DeallocPOfflineCacheUpdateChild(
       POfflineCacheUpdateChild* offlineCacheUpdate);
 
   PWebrtcGlobalChild* AllocPWebrtcGlobalChild();
 
   bool DeallocPWebrtcGlobalChild(PWebrtcGlobalChild* aActor);
 
   PContentPermissionRequestChild* AllocPContentPermissionRequestChild(
-      const InfallibleTArray<PermissionRequest>& aRequests,
+      const nsTArray<PermissionRequest>& aRequests,
       const IPC::Principal& aPrincipal,
       const IPC::Principal& aTopLevelPrincipal,
       const bool& aIsHandlingUserInput, const bool& aDocumentHasUserInput,
       const DOMTimeStamp aPageLoadTimestamp, const TabId& aTabId);
   bool DeallocPContentPermissionRequestChild(
       PContentPermissionRequestChild* actor);
 
   // Windows specific - set up audio session
@@ -612,17 +612,17 @@ class ContentChild final : public PConte
       nsTArray<DynamicScalarDefinition>&& aDefs);
 
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
   bool SendGetA11yContentId();
 #endif  // defined(XP_WIN) && defined(ACCESSIBILITY)
 
   // Get a reference to the font list passed from the chrome process,
   // for use during gfx initialization.
-  InfallibleTArray<mozilla::dom::SystemFontListEntry>& SystemFontList() {
+  nsTArray<mozilla::dom::SystemFontListEntry>& SystemFontList() {
     return mFontList;
   }
 
   // PURLClassifierChild
   PURLClassifierChild* AllocPURLClassifierChild(const Principal& aPrincipal,
                                                 bool* aSuccess);
   bool DeallocPURLClassifierChild(PURLClassifierChild* aActor);
 
@@ -744,27 +744,27 @@ class ContentChild final : public PConte
   virtual PContentChild::Result OnMessageReceived(const Message& aMsg) override;
 #else
   using PContentChild::OnMessageReceived;
 #endif
 
   virtual PContentChild::Result OnMessageReceived(const Message& aMsg,
                                                   Message*& aReply) override;
 
-  InfallibleTArray<nsAutoPtr<AlertObserver>> mAlertObservers;
+  nsTArray<nsAutoPtr<AlertObserver>> mAlertObservers;
   RefPtr<ConsoleListener> mConsoleListener;
 
   nsTHashtable<nsPtrHashKey<nsIObserver>> mIdleObservers;
 
-  InfallibleTArray<nsString> mAvailableDictionaries;
+  nsTArray<nsString> mAvailableDictionaries;
 
   // Temporary storage for a list of available fonts, passed from the
   // parent process and used to initialize gfx in the child. Currently used
   // only on MacOSX and Linux.
-  InfallibleTArray<mozilla::dom::SystemFontListEntry> mFontList;
+  nsTArray<mozilla::dom::SystemFontListEntry> mFontList;
   // Temporary storage for nsXPLookAndFeel flags.
   nsTArray<LookAndFeelInt> mLookAndFeelCache;
 
   /**
    * An ID unique to the process containing our corresponding
    * content parent.
    *
    * We expect our content parent to set this ID immediately after opening a
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -713,17 +713,17 @@ const nsDependentSubstring RemoteTypePre
   return StringHead(aContentProcessType, equalIdx);
 }
 
 /*static*/
 uint32_t ContentParent::GetMaxProcessCount(
     const nsAString& aContentProcessType) {
   // Max process count is based only on the prefix.
   const nsDependentSubstring processTypePrefix =
-    RemoteTypePrefix(aContentProcessType);
+      RemoteTypePrefix(aContentProcessType);
 
   // Check for the default remote type of "web", as it uses different prefs.
   if (processTypePrefix.EqualsLiteral("web")) {
     return GetMaxWebProcessCount();
   }
 
   // Read the pref controling this remote type. `dom.ipc.processCount` is not
   // used as a fallback, as it is intended to control the number of "web"
@@ -2666,17 +2666,17 @@ bool ContentParent::IsAlive() const {
 int32_t ContentParent::Pid() const {
   if (!mSubprocess || !mSubprocess->GetChildProcessHandle()) {
     return -1;
   }
   return base::GetProcId(mSubprocess->GetChildProcessHandle());
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvGetGfxVars(
-    InfallibleTArray<GfxVarUpdate>* aVars) {
+    nsTArray<GfxVarUpdate>* aVars) {
   // Ensure gfxVars is initialized (for xpcshell tests).
   gfxVars::Initialize();
 
   *aVars = gfxVars::FetchNonDefaultVars();
 
   // Now that content has initialized gfxVars, we can start listening for
   // updates.
   gfxVars::AddReceiver(this);
@@ -2754,17 +2754,17 @@ bool ContentParent::IsInputEventQueueSup
 void ContentParent::OnVarChanged(const GfxVarUpdate& aVar) {
   if (!mIPCOpen) {
     return;
   }
   Unused << SendVarUpdate(aVar);
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvReadFontList(
-    InfallibleTArray<FontListEntry>* retValue) {
+    nsTArray<FontListEntry>* retValue) {
 #ifdef ANDROID
   gfxAndroidPlatform::GetPlatform()->GetSystemFontList(retValue);
 #endif
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvSetClipboard(
     const IPCDataTransfer& aDataTransfer, const bool& aIsPrivateData,
@@ -2889,17 +2889,17 @@ mozilla::ipc::IPCResult ContentParent::R
 
   sound->PlayEventSound(aEventId);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvGetIconForExtension(
     const nsCString& aFileExt, const uint32_t& aIconSize,
-    InfallibleTArray<uint8_t>* bits) {
+    nsTArray<uint8_t>* bits) {
 #ifdef MOZ_WIDGET_ANDROID
   NS_ASSERTION(AndroidBridge::Bridge() != nullptr,
                "AndroidBridge is not available");
   if (AndroidBridge::Bridge() == nullptr) {
     // Do not fail - just no icon will be shown
     return IPC_OK();
   }
 
@@ -3945,17 +3945,17 @@ mozilla::ipc::IPCResult ContentParent::R
     Unused << NS_WARN_IF(NS_FAILED(rv));
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvSyncMessage(
     const nsString& aMsg, const ClonedMessageData& aData,
-    InfallibleTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
+    nsTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
     nsTArray<StructuredCloneData>* aRetvals) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("ContentParent::RecvSyncMessage",
                                              OTHER, aMsg);
   MMPrinter::Print("ContentParent::RecvSyncMessage", aMsg, aData);
 
   CrossProcessCpowHolder cpows(this, aCpows);
   RefPtr<nsFrameMessageManager> ppm = mMessageManager;
   if (ppm) {
@@ -3965,17 +3965,17 @@ mozilla::ipc::IPCResult ContentParent::R
     ppm->ReceiveMessage(ppm, nullptr, aMsg, true, &data, &cpows, aPrincipal,
                         aRetvals, IgnoreErrors());
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvRpcMessage(
     const nsString& aMsg, const ClonedMessageData& aData,
-    InfallibleTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
+    nsTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
     nsTArray<StructuredCloneData>* aRetvals) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("ContentParent::RecvRpcMessage",
                                              OTHER, aMsg);
   MMPrinter::Print("ContentParent::RecvRpcMessage", aMsg, aData);
 
   CrossProcessCpowHolder cpows(this, aCpows);
   RefPtr<nsFrameMessageManager> ppm = mMessageManager;
   if (ppm) {
@@ -3984,17 +3984,17 @@ mozilla::ipc::IPCResult ContentParent::R
 
     ppm->ReceiveMessage(ppm, nullptr, aMsg, true, &data, &cpows, aPrincipal,
                         aRetvals, IgnoreErrors());
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvAsyncMessage(
-    const nsString& aMsg, InfallibleTArray<CpowEntry>&& aCpows,
+    const nsString& aMsg, nsTArray<CpowEntry>&& aCpows,
     const IPC::Principal& aPrincipal, const ClonedMessageData& aData) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("ContentParent::RecvAsyncMessage",
                                              OTHER, aMsg);
   MMPrinter::Print("ContentParent::RecvAsyncMessage", aMsg, aData);
 
   CrossProcessCpowHolder cpows(this, aCpows);
   RefPtr<nsFrameMessageManager> ppm = mMessageManager;
   if (ppm) {
@@ -4200,17 +4200,17 @@ nsresult ContentParent::DoSendAsyncMessa
                                            const nsAString& aMessage,
                                            StructuredCloneData& aHelper,
                                            JS::Handle<JSObject*> aCpows,
                                            nsIPrincipal* aPrincipal) {
   ClonedMessageData data;
   if (!BuildClonedMessageDataForParent(this, aHelper, data)) {
     return NS_ERROR_DOM_DATA_CLONE_ERR;
   }
-  InfallibleTArray<CpowEntry> cpows;
+  nsTArray<CpowEntry> cpows;
   jsipc::CPOWManager* mgr = GetCPOWManager();
   if (aCpows && (!mgr || !mgr->Wrap(aCx, aCpows, &cpows))) {
     return NS_ERROR_UNEXPECTED;
   }
   if (!SendAsyncMessage(nsString(aMessage), cpows, Principal(aPrincipal),
                         data)) {
     return NS_ERROR_UNEXPECTED;
   }
@@ -4460,26 +4460,26 @@ bool ContentParent::IgnoreIPCPrincipal()
   }
   return sIgnoreIPCPrincipal;
 }
 
 void ContentParent::NotifyUpdatedDictionaries() {
   RefPtr<mozSpellChecker> spellChecker(mozSpellChecker::Create());
   MOZ_ASSERT(spellChecker, "No spell checker?");
 
-  InfallibleTArray<nsString> dictionaries;
+  nsTArray<nsString> dictionaries;
   spellChecker->GetDictionaryList(&dictionaries);
 
   for (auto* cp : AllProcesses(eLive)) {
     Unused << cp->SendUpdateDictionaryList(dictionaries);
   }
 }
 
 void ContentParent::NotifyUpdatedFonts() {
-  InfallibleTArray<SystemFontListEntry> fontList;
+  nsTArray<SystemFontListEntry> fontList;
   gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
 
   for (auto* cp : AllProcesses(eLive)) {
     Unused << cp->SendUpdateFontList(fontList);
   }
 }
 
 void ContentParent::NotifyRebuildFontList() {
@@ -4639,17 +4639,17 @@ mozilla::ipc::IPCResult ContentParent::R
     }
     dragSession->UpdateDragEffect();
   }
   return IPC_OK();
 }
 
 PContentPermissionRequestParent*
 ContentParent::AllocPContentPermissionRequestParent(
-    const InfallibleTArray<PermissionRequest>& aRequests,
+    const nsTArray<PermissionRequest>& aRequests,
     const IPC::Principal& aPrincipal, const IPC::Principal& aTopLevelPrincipal,
     const bool& aIsHandlingUserInput, const bool& aDocumentHasUserInput,
     const DOMTimeStamp& aPageLoadTimestamp, const TabId& aTabId) {
   ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
   RefPtr<BrowserParent> tp =
       cpm->GetTopLevelBrowserParentByProcessAndTabId(this->ChildID(), aTabId);
   if (!tp) {
     return nullptr;
@@ -5153,17 +5153,17 @@ mozilla::ipc::IPCResult ContentParent::R
     const nsString& aMessageId) {
   PushMessageDispatcher dispatcher(aScope, aPrincipal, aMessageId, Nothing());
   Unused << NS_WARN_IF(NS_FAILED(dispatcher.NotifyObserversAndWorkers()));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvNotifyPushObserversWithData(
     const nsCString& aScope, const IPC::Principal& aPrincipal,
-    const nsString& aMessageId, InfallibleTArray<uint8_t>&& aData) {
+    const nsString& aMessageId, nsTArray<uint8_t>&& aData) {
   PushMessageDispatcher dispatcher(aScope, aPrincipal, aMessageId, Some(aData));
   Unused << NS_WARN_IF(NS_FAILED(dispatcher.NotifyObserversAndWorkers()));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 ContentParent::RecvNotifyPushSubscriptionChangeObservers(
     const nsCString& aScope, const IPC::Principal& aPrincipal) {
@@ -5468,38 +5468,38 @@ void ContentParent::EnsurePermissionsByK
 }
 
 bool ContentParent::NeedsPermissionsUpdate(
     const nsACString& aPermissionKey) const {
   return mActivePermissionKeys.Contains(aPermissionKey);
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvAccumulateChildHistograms(
-    InfallibleTArray<HistogramAccumulation>&& aAccumulations) {
+    nsTArray<HistogramAccumulation>&& aAccumulations) {
   TelemetryIPC::AccumulateChildHistograms(GetTelemetryProcessID(mRemoteType),
                                           aAccumulations);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvAccumulateChildKeyedHistograms(
-    InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations) {
+    nsTArray<KeyedHistogramAccumulation>&& aAccumulations) {
   TelemetryIPC::AccumulateChildKeyedHistograms(
       GetTelemetryProcessID(mRemoteType), aAccumulations);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvUpdateChildScalars(
-    InfallibleTArray<ScalarAction>&& aScalarActions) {
+    nsTArray<ScalarAction>&& aScalarActions) {
   TelemetryIPC::UpdateChildScalars(GetTelemetryProcessID(mRemoteType),
                                    aScalarActions);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvUpdateChildKeyedScalars(
-    InfallibleTArray<KeyedScalarAction>&& aScalarActions) {
+    nsTArray<KeyedScalarAction>&& aScalarActions) {
   TelemetryIPC::UpdateChildKeyedScalars(GetTelemetryProcessID(mRemoteType),
                                         aScalarActions);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvRecordChildEvents(
     nsTArray<mozilla::Telemetry::ChildEventData>&& aEvents) {
   TelemetryIPC::RecordChildEvents(GetTelemetryProcessID(mRemoteType), aEvents);
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -499,17 +499,17 @@ class ContentParent final : public PCont
   mozilla::ipc::IPCResult RecvSetOfflinePermission(
       const IPC::Principal& principal);
 
   mozilla::ipc::IPCResult RecvFinishShutdown();
 
   void MaybeInvokeDragSession(BrowserParent* aParent);
 
   PContentPermissionRequestParent* AllocPContentPermissionRequestParent(
-      const InfallibleTArray<PermissionRequest>& aRequests,
+      const nsTArray<PermissionRequest>& aRequests,
       const IPC::Principal& aPrincipal,
       const IPC::Principal& aTopLevelPrincipal,
       const bool& aIsHandlingUserInput, const bool& aDocumentHasUserInput,
       const DOMTimeStamp& aPageLoadTimestamp, const TabId& aTabId);
 
   bool DeallocPContentPermissionRequestParent(
       PContentPermissionRequestParent* actor);
 
@@ -928,20 +928,19 @@ class ContentParent final : public PCont
       PSpeechSynthesisParent* aActor) override;
 
   PWebBrowserPersistDocumentParent* AllocPWebBrowserPersistDocumentParent(
       PBrowserParent* aBrowser, const uint64_t& aOuterWindowID);
 
   bool DeallocPWebBrowserPersistDocumentParent(
       PWebBrowserPersistDocumentParent* aActor);
 
-  mozilla::ipc::IPCResult RecvGetGfxVars(InfallibleTArray<GfxVarUpdate>* aVars);
+  mozilla::ipc::IPCResult RecvGetGfxVars(nsTArray<GfxVarUpdate>* aVars);
 
-  mozilla::ipc::IPCResult RecvReadFontList(
-      InfallibleTArray<FontListEntry>* retValue);
+  mozilla::ipc::IPCResult RecvReadFontList(nsTArray<FontListEntry>* retValue);
 
   mozilla::ipc::IPCResult RecvSetClipboard(
       const IPCDataTransfer& aDataTransfer, const bool& aIsPrivateData,
       const IPC::Principal& aRequestingPrincipal,
       const uint32_t& aContentPolicyType, const int32_t& aWhichClipboard);
 
   mozilla::ipc::IPCResult RecvGetClipboard(nsTArray<nsCString>&& aTypes,
                                            const int32_t& aWhichClipboard,
@@ -956,19 +955,19 @@ class ContentParent final : public PCont
   mozilla::ipc::IPCResult RecvGetExternalClipboardFormats(
       const int32_t& aWhichClipboard, const bool& aPlainTextOnly,
       nsTArray<nsCString>* aTypes);
 
   mozilla::ipc::IPCResult RecvPlaySound(const URIParams& aURI);
   mozilla::ipc::IPCResult RecvBeep();
   mozilla::ipc::IPCResult RecvPlayEventSound(const uint32_t& aEventId);
 
-  mozilla::ipc::IPCResult RecvGetIconForExtension(
-      const nsCString& aFileExt, const uint32_t& aIconSize,
-      InfallibleTArray<uint8_t>* bits);
+  mozilla::ipc::IPCResult RecvGetIconForExtension(const nsCString& aFileExt,
+                                                  const uint32_t& aIconSize,
+                                                  nsTArray<uint8_t>* bits);
 
   mozilla::ipc::IPCResult RecvGetShowPasswordSetting(bool* showPassword);
 
   mozilla::ipc::IPCResult RecvStartVisitedQuery(const URIParams& uri);
 
   mozilla::ipc::IPCResult RecvSetURITitle(const URIParams& uri,
                                           const nsString& title);
 
@@ -990,26 +989,26 @@ class ContentParent final : public PCont
 
   mozilla::ipc::IPCResult RecvLoadURIExternal(const URIParams& uri,
                                               PBrowserParent* windowContext);
   mozilla::ipc::IPCResult RecvExtProtocolChannelConnectParent(
       const uint32_t& registrarId);
 
   mozilla::ipc::IPCResult RecvSyncMessage(
       const nsString& aMsg, const ClonedMessageData& aData,
-      InfallibleTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
+      nsTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
       nsTArray<StructuredCloneData>* aRetvals);
 
   mozilla::ipc::IPCResult RecvRpcMessage(
       const nsString& aMsg, const ClonedMessageData& aData,
-      InfallibleTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
+      nsTArray<CpowEntry>&& aCpows, const IPC::Principal& aPrincipal,
       nsTArray<StructuredCloneData>* aRetvals);
 
   mozilla::ipc::IPCResult RecvAsyncMessage(const nsString& aMsg,
-                                           InfallibleTArray<CpowEntry>&& aCpows,
+                                           nsTArray<CpowEntry>&& aCpows,
                                            const IPC::Principal& aPrincipal,
                                            const ClonedMessageData& aData);
 
   // MOZ_CAN_RUN_SCRIPT_BOUNDARY because we don't have MOZ_CAN_RUN_SCRIPT bits
   // in IPC code yet.
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   mozilla::ipc::IPCResult RecvAddGeolocationListener(
       const IPC::Principal& aPrincipal, const bool& aHighAccuracy);
@@ -1131,17 +1130,17 @@ class ContentParent final : public PCont
                                                     const uint32_t& aDecodeFPS);
 
   mozilla::ipc::IPCResult RecvNotifyPushObservers(
       const nsCString& aScope, const IPC::Principal& aPrincipal,
       const nsString& aMessageId);
 
   mozilla::ipc::IPCResult RecvNotifyPushObserversWithData(
       const nsCString& aScope, const IPC::Principal& aPrincipal,
-      const nsString& aMessageId, InfallibleTArray<uint8_t>&& aData);
+      const nsString& aMessageId, nsTArray<uint8_t>&& aData);
 
   mozilla::ipc::IPCResult RecvNotifyPushSubscriptionChangeObservers(
       const nsCString& aScope, const IPC::Principal& aPrincipal);
 
   mozilla::ipc::IPCResult RecvPushError(const nsCString& aScope,
                                         const IPC::Principal& aPrincipal,
                                         const nsString& aMessage,
                                         const uint32_t& aFlags);
@@ -1151,23 +1150,23 @@ class ContentParent final : public PCont
 
   mozilla::ipc::IPCResult RecvGetFilesRequest(const nsID& aID,
                                               const nsString& aDirectoryPath,
                                               const bool& aRecursiveFlag);
 
   mozilla::ipc::IPCResult RecvDeleteGetFilesRequest(const nsID& aID);
 
   mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
-      InfallibleTArray<HistogramAccumulation>&& aAccumulations);
+      nsTArray<HistogramAccumulation>&& aAccumulations);
   mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
-      InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations);
+      nsTArray<KeyedHistogramAccumulation>&& aAccumulations);
   mozilla::ipc::IPCResult RecvUpdateChildScalars(
-      InfallibleTArray<ScalarAction>&& aScalarActions);
+      nsTArray<ScalarAction>&& aScalarActions);
   mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
-      InfallibleTArray<KeyedScalarAction>&& aScalarActions);
+      nsTArray<KeyedScalarAction>&& aScalarActions);
   mozilla::ipc::IPCResult RecvRecordChildEvents(
       nsTArray<ChildEventData>&& events);
   mozilla::ipc::IPCResult RecvRecordDiscardedData(
       const DiscardedData& aDiscardedData);
   mozilla::ipc::IPCResult RecvRecordOrigin(const uint32_t& aMetricId,
                                            const nsCString& aOrigin);
   mozilla::ipc::IPCResult RecvReportContentBlockingLog(
       const IPCStream& aIPCStream);
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -146,17 +146,17 @@ void FilePickerParent::SendFilesOrDirect
                                      aData[0].mDirectoryPath);
 
     InputDirectory input;
     input.directoryPath() = aData[0].mDirectoryPath;
     Unused << Send__delete__(this, input, mResult);
     return;
   }
 
-  InfallibleTArray<IPCBlob> ipcBlobs;
+  nsTArray<IPCBlob> ipcBlobs;
 
   for (unsigned i = 0; i < aData.Length(); i++) {
     IPCBlob ipcBlob;
 
     MOZ_ASSERT(aData[i].mType == BlobImplOrString::eBlobImpl);
     nsresult rv = IPCBlobUtils::Serialize(aData[i].mBlobImpl, parent, ipcBlob);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       break;
@@ -234,19 +234,18 @@ bool FilePickerParent::CreateFilePicker(
   }
 
   return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode));
 }
 
 mozilla::ipc::IPCResult FilePickerParent::RecvOpen(
     const int16_t& aSelectedType, const bool& aAddToRecentDocs,
     const nsString& aDefaultFile, const nsString& aDefaultExtension,
-    InfallibleTArray<nsString>&& aFilters,
-    InfallibleTArray<nsString>&& aFilterNames,
-    InfallibleTArray<nsString>&& aRawFilters, const nsString& aDisplayDirectory,
+    nsTArray<nsString>&& aFilters, nsTArray<nsString>&& aFilterNames,
+    nsTArray<nsString>&& aRawFilters, const nsString& aDisplayDirectory,
     const nsString& aDisplaySpecialDirectory, const nsString& aOkButtonLabel) {
   if (!CreateFilePicker()) {
     Unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
     return IPC_OK();
   }
 
   mFilePicker->SetAddToRecentDocs(aAddToRecentDocs);
 
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -32,26 +32,22 @@ class FilePickerParent : public PFilePic
     RefPtr<BlobImpl> mBlobImpl;
     nsString mDirectoryPath;
 
     enum { eBlobImpl, eDirectoryPath } mType;
   };
 
   void SendFilesOrDirectories(const nsTArray<BlobImplOrString>& aData);
 
-  mozilla::ipc::IPCResult RecvOpen(const int16_t& aSelectedType,
-                                   const bool& aAddToRecentDocs,
-                                   const nsString& aDefaultFile,
-                                   const nsString& aDefaultExtension,
-                                   InfallibleTArray<nsString>&& aFilters,
-                                   InfallibleTArray<nsString>&& aFilterNames,
-                                   InfallibleTArray<nsString>&& aRawFilters,
-                                   const nsString& aDisplayDirectory,
-                                   const nsString& aDisplaySpecialDirectory,
-                                   const nsString& aOkButtonLabel);
+  mozilla::ipc::IPCResult RecvOpen(
+      const int16_t& aSelectedType, const bool& aAddToRecentDocs,
+      const nsString& aDefaultFile, const nsString& aDefaultExtension,
+      nsTArray<nsString>&& aFilters, nsTArray<nsString>&& aFilterNames,
+      nsTArray<nsString>&& aRawFilters, const nsString& aDisplayDirectory,
+      const nsString& aDisplaySpecialDirectory, const nsString& aOkButtonLabel);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   class FilePickerShownCallback : public nsIFilePickerShownCallback {
    public:
     explicit FilePickerShownCallback(FilePickerParent* aFilePickerParent)
         : mFilePickerParent(aFilePickerParent) {}
 
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -26,42 +26,39 @@ include JavaScriptTypes;
 include URIParams;
 include PPrintingTypes;
 include PTabContext;
 include PBackgroundSharedTypes;
 
 include "mozilla/GfxMessageUtils.h";
 include "mozilla/layers/LayersMessageUtils.h";
 
-using moveonly mozilla::gfx::PaintFragment from "mozilla/gfx/CrossProcessPaint.h";
 using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h";
 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
 using mozilla::LayoutDeviceIntPoint from "Units.h";
 using mozilla::LayoutDevicePoint from "Units.h";
 using mozilla::ScreenIntPoint from "Units.h";
 using ScreenIntSize from "Units.h";
 using struct mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
 using struct mozilla::layers::ZoomConstraints from "mozilla/layers/ZoomConstraints.h";
 using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
 using mozilla::layers::LayersObserverEpoch from "mozilla/layers/LayersTypes.h";
 using mozilla::layers::MaybeZoomConstraints from "mozilla/layers/ZoomConstraints.h";
 using mozilla::layers::GeckoContentController::TapType from "mozilla/layers/GeckoContentController.h";
 using ScrollableLayerGuid::ViewID from "mozilla/layers/ScrollableLayerGuid.h";
 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
 using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h";
-using nscolor from "nsColor.h";
 using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h";
 using struct mozilla::widget::IMENotification from "mozilla/widget/IMEData.h";
 using struct mozilla::widget::IMENotificationRequests from "mozilla/widget/IMEData.h";
 using struct mozilla::widget::IMEState from "mozilla/widget/IMEData.h";
 using struct mozilla::widget::InputContext from "mozilla/widget/IMEData.h";
 using struct mozilla::widget::InputContextAction from "mozilla/widget/IMEData.h";
 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
 using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
-using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h";
 using class mozilla::ContentCache from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
 using struct nsRect from "nsRect.h";
 using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
 using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
@@ -881,19 +878,16 @@ child:
      *        True if the child should force a paint even if it's already
      *        visible.
      * @param aEpoch
      *        The layer observer epoch for this activation. This message should be
      *        ignored if this epoch has already been observed (via
      *        PaintWhileInterruptingJS).
      */
     async RenderLayers(bool aEnabled, bool aForceRepaint, LayersObserverEpoch aEpoch);
-
-    async RequestRootPaint(IntRect aRect, float aScale, nscolor aBackgroundColor) returns (PaintFragment retval);
-    async RequestSubPaint(float aScale, nscolor aBackgroundColor) returns (PaintFragment retval);
 child:
     /**
      * Notify the child that it shouldn't paint the offscreen displayport.
      * This is useful to speed up interactive operations over async
      * scrolling performance like resize, tabswitch, pageload.
      *
      * Each enable call must be matched with a disable call. The child
      * will remain in the suppress mode as long as there's
--- a/dom/ipc/PWindowGlobal.ipdl
+++ b/dom/ipc/PWindowGlobal.ipdl
@@ -6,16 +6,19 @@
 
 include protocol PBrowser;
 include protocol PInProcess;
 include protocol PBrowserBridge;
 
 include DOMTypes;
 
 using JSWindowActorMessageKind from "mozilla/dom/JSWindowActor.h";
+using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h";
+using moveonly mozilla::gfx::PaintFragment from "mozilla/gfx/CrossProcessPaint.h";
+using nscolor from "nsColor.h";
 
 namespace mozilla {
 namespace dom {
 
 struct JSWindowActorMessageMeta {
   nsString actorName;
   nsString messageName;
   uint64_t queryId;
@@ -35,16 +38,18 @@ async protocol PWindowGlobal
 child:
   async __delete__();
 
   async ChangeFrameRemoteness(BrowsingContext aFrameContext,
                               nsString aRemoteType,
                               uint64_t aSwitchId)
       returns (nsresult rv, nullable PBrowserBridge bridge);
 
+  async DrawSnapshot(IntRect? aRect, float aScale, nscolor aBackgroundColor) returns (PaintFragment retval);
+
   /**
    * Returns the serialized security info associated with this window.
    */
   async GetSecurityInfo() returns(nsCString? serializedSecInfo);
 
 both:
   async RawMessage(JSWindowActorMessageMeta aMetadata, ClonedMessageData aData);
 
--- a/dom/ipc/StructuredCloneData.cpp
+++ b/dom/ipc/StructuredCloneData.cpp
@@ -170,17 +170,17 @@ bool BuildClonedMessageData(M* aManager,
 
   const nsTArray<nsCOMPtr<nsIInputStream>>& inputStreams = aData.InputStreams();
   if (!inputStreams.IsEmpty()) {
     if (NS_WARN_IF(
             !aData.IPCStreams().SetCapacity(inputStreams.Length(), fallible))) {
       return false;
     }
 
-    InfallibleTArray<IPCStream>& streams = aClonedData.inputStreams();
+    nsTArray<IPCStream>& streams = aClonedData.inputStreams();
     uint32_t length = inputStreams.Length();
     streams.SetCapacity(length);
     for (uint32_t i = 0; i < length; ++i) {
       AutoIPCStream* stream = aData.IPCStreams().AppendElement(fallible);
       if (NS_WARN_IF(!stream)) {
         return false;
       }
 
@@ -257,18 +257,17 @@ struct MemoryTraits<StealMemory> {
 // Note that there isn't actually a difference between Parent/BackgroundParent
 // and Child/BackgroundChild in this implementation.  The calling methods,
 // however, do maintain the distinction for code-reading purposes and are backed
 // by assertions to enforce there is no misuse.
 template <MemoryFlavorEnum MemoryFlavor, ActorFlavorEnum Flavor>
 static void UnpackClonedMessageData(
     typename MemoryTraits<MemoryFlavor>::ClonedMessageType& aClonedData,
     StructuredCloneData& aData) {
-  const InfallibleTArray<MessagePortIdentifier>& identifiers =
-      aClonedData.identfiers();
+  const nsTArray<MessagePortIdentifier>& identifiers = aClonedData.identfiers();
 
   MemoryTraits<MemoryFlavor>::ProvideBuffer(aClonedData, aData);
 
   if (aData.SupportsTransferring()) {
     aData.PortIdentifiers().AppendElements(identifiers);
   }
 
   const nsTArray<IPCBlob>& blobs = aClonedData.blobs();
@@ -278,17 +277,17 @@ static void UnpackClonedMessageData(
     for (uint32_t i = 0; i < length; ++i) {
       RefPtr<BlobImpl> blobImpl = IPCBlobUtils::Deserialize(blobs[i]);
       MOZ_ASSERT(blobImpl);
 
       aData.BlobImpls().AppendElement(blobImpl);
     }
   }
 
-  const InfallibleTArray<IPCStream>& streams = aClonedData.inputStreams();
+  const nsTArray<IPCStream>& streams = aClonedData.inputStreams();
   if (!streams.IsEmpty()) {
     uint32_t length = streams.Length();
     aData.InputStreams().SetCapacity(length);
     for (uint32_t i = 0; i < length; ++i) {
       nsCOMPtr<nsIInputStream> stream = DeserializeIPCStream(streams[i]);
       aData.InputStreams().AppendElement(stream);
     }
   }
--- a/dom/ipc/WindowGlobalChild.cpp
+++ b/dom/ipc/WindowGlobalChild.cpp
@@ -13,16 +13,17 @@
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/MozFrameLoaderOwnerBinding.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/BrowserBridgeChild.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/WindowGlobalActorsBinding.h"
 #include "mozilla/dom/WindowGlobalParent.h"
 #include "mozilla/ipc/InProcessChild.h"
+#include "nsContentUtils.h"
 #include "nsDocShell.h"
 #include "nsFrameLoaderOwner.h"
 #include "nsGlobalWindowInner.h"
 #include "nsFrameLoaderOwner.h"
 #include "nsQueryObject.h"
 #include "nsSerializationHelper.h"
 
 #include "mozilla/dom/JSWindowActorBinding.h"
@@ -253,16 +254,30 @@ IPCResult WindowGlobalChild::RecvChangeF
   nsresult rv = ChangeFrameRemoteness(this, aBc, aRemoteType, aPendingSwitchId,
                                       getter_AddRefs(bbc));
 
   // To make the type system happy, we've gotta do some gymnastics.
   aResolver(Tuple<const nsresult&, PBrowserBridgeChild*>(rv, bbc));
   return IPC_OK();
 }
 
+mozilla::ipc::IPCResult WindowGlobalChild::RecvDrawSnapshot(
+    const Maybe<IntRect>& aRect, const float& aScale,
+    const nscolor& aBackgroundColor, DrawSnapshotResolver&& aResolve) {
+  nsCOMPtr<nsIDocShell> docShell = BrowsingContext()->GetDocShell();
+  if (!docShell) {
+    aResolve(gfx::PaintFragment{});
+    return IPC_OK();
+  }
+
+  aResolve(
+      gfx::PaintFragment::Record(docShell, aRect, aScale, aBackgroundColor));
+  return IPC_OK();
+}
+
 mozilla::ipc::IPCResult WindowGlobalChild::RecvGetSecurityInfo(
     GetSecurityInfoResolver&& aResolve) {
   Maybe<nsCString> result;
 
   if (nsCOMPtr<Document> doc = mWindowGlobal->GetDoc()) {
     nsCOMPtr<nsISupports> secInfo;
     nsresult rv = NS_OK;
 
--- a/dom/ipc/WindowGlobalChild.h
+++ b/dom/ipc/WindowGlobalChild.h
@@ -98,16 +98,21 @@ class WindowGlobalChild final : public W
   // IPC messages
   mozilla::ipc::IPCResult RecvRawMessage(const JSWindowActorMessageMeta& aMeta,
                                          const ClonedMessageData& aData);
 
   mozilla::ipc::IPCResult RecvChangeFrameRemoteness(
       dom::BrowsingContext* aBc, const nsString& aRemoteType,
       uint64_t aPendingSwitchId, ChangeFrameRemotenessResolver&& aResolver);
 
+  mozilla::ipc::IPCResult RecvDrawSnapshot(const Maybe<IntRect>& aRect,
+                                           const float& aScale,
+                                           const nscolor& aBackgroundColor,
+                                           DrawSnapshotResolver&& aResolve);
+
   mozilla::ipc::IPCResult RecvGetSecurityInfo(
       GetSecurityInfoResolver&& aResolve);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
  private:
   WindowGlobalChild(nsGlobalWindowInner* aWindow, dom::BrowsingContext* aBc);
   ~WindowGlobalChild();
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -13,16 +13,18 @@
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/BrowserHost.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/dom/WindowGlobalActorsBinding.h"
 #include "mozilla/dom/WindowGlobalChild.h"
 #include "mozilla/dom/ChromeUtils.h"
 #include "mozilla/dom/ipc/IdType.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
+#include "mozilla/ServoCSSParser.h"
+#include "mozilla/ServoStyleSet.h"
 #include "mozJSComponentLoader.h"
 #include "nsContentUtils.h"
 #include "nsDocShell.h"
 #include "nsError.h"
 #include "nsFrameLoader.h"
 #include "nsFrameLoaderOwner.h"
 #include "nsGlobalWindowInner.h"
 #include "nsQueryObject.h"
@@ -279,17 +281,17 @@ already_AddRefed<Promise> WindowGlobalPa
     dom::BrowsingContext* aBc, const nsAString& aRemoteType,
     uint64_t aPendingSwitchId, ErrorResult& aRv) {
   RefPtr<BrowserParent> embedderBrowserParent = GetBrowserParent();
   if (NS_WARN_IF(!embedderBrowserParent)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  nsIGlobalObject* global = xpc::NativeGlobal(xpc::PrivilegedJunkScope());
+  nsIGlobalObject* global = GetParentObject();
   RefPtr<Promise> promise = Promise::Create(global, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<CanonicalBrowsingContext> browsingContext =
       CanonicalBrowsingContext::Cast(aBc);
 
@@ -335,25 +337,68 @@ already_AddRefed<Promise> WindowGlobalPa
     promise->MaybeReject(NS_ERROR_FAILURE);
   };
 
   SendChangeFrameRemoteness(aBc, PromiseFlatString(aRemoteType),
                             aPendingSwitchId, resolve, reject);
   return promise.forget();
 }
 
+already_AddRefed<mozilla::dom::Promise> WindowGlobalParent::DrawSnapshot(
+    const DOMRect* aRect, double aScale, const nsAString& aBackgroundColor,
+    mozilla::ErrorResult& aRv) {
+  nsIGlobalObject* global = GetParentObject();
+  RefPtr<Promise> promise = Promise::Create(global, aRv);
+  if (NS_WARN_IF(aRv.Failed())) {
+    return nullptr;
+  }
+
+  nscolor color;
+  if (NS_WARN_IF(!ServoCSSParser::ComputeColor(nullptr, NS_RGB(0, 0, 0),
+                                               aBackgroundColor, &color,
+                                               nullptr, nullptr))) {
+    aRv = NS_ERROR_FAILURE;
+    return nullptr;
+  }
+
+  if (!gfx::CrossProcessPaint::Start(this, aRect, (float)aScale, color,
+                                     promise)) {
+    aRv = NS_ERROR_FAILURE;
+    return nullptr;
+  }
+  return promise.forget();
+}
+
+void WindowGlobalParent::DrawSnapshotInternal(gfx::CrossProcessPaint* aPaint,
+                                              const Maybe<IntRect>& aRect,
+                                              float aScale,
+                                              nscolor aBackgroundColor) {
+  auto promise = SendDrawSnapshot(aRect, aScale, aBackgroundColor);
+
+  RefPtr<gfx::CrossProcessPaint> paint(aPaint);
+  RefPtr<WindowGlobalParent> wgp(this);
+  promise->Then(
+      GetMainThreadSerialEventTarget(), __func__,
+      [paint, wgp](PaintFragment&& aFragment) {
+        paint->ReceiveFragment(wgp, std::move(aFragment));
+      },
+      [paint, wgp](ResponseRejectReason&& aReason) {
+        paint->LostFragment(wgp);
+      });
+}
+
 already_AddRefed<Promise> WindowGlobalParent::GetSecurityInfo(
     ErrorResult& aRv) {
   RefPtr<BrowserParent> browserParent = GetBrowserParent();
   if (NS_WARN_IF(!browserParent)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
-  nsIGlobalObject* global = xpc::NativeGlobal(xpc::PrivilegedJunkScope());
+  nsIGlobalObject* global = GetParentObject();
   RefPtr<Promise> promise = Promise::Create(global, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   SendGetSecurityInfo(
       [promise](Maybe<nsCString>&& aResult) {
         if (aResult) {
@@ -405,17 +450,17 @@ WindowGlobalParent::~WindowGlobalParent(
   MOZ_ASSERT(!mWindowActors.Count());
 }
 
 JSObject* WindowGlobalParent::WrapObject(JSContext* aCx,
                                          JS::Handle<JSObject*> aGivenProto) {
   return WindowGlobalParent_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-nsISupports* WindowGlobalParent::GetParentObject() {
+nsIGlobalObject* WindowGlobalParent::GetParentObject() {
   return xpc::NativeGlobal(xpc::PrivilegedJunkScope());
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(WindowGlobalParent, WindowGlobalActor,
                                    mFrameLoader, mBrowsingContext,
                                    mWindowActors)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(WindowGlobalParent,
--- a/dom/ipc/WindowGlobalParent.h
+++ b/dom/ipc/WindowGlobalParent.h
@@ -3,40 +3,47 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_WindowGlobalParent_h
 #define mozilla_dom_WindowGlobalParent_h
 
 #include "mozilla/RefPtr.h"
+#include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/PWindowGlobalParent.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "nsRefPtrHashtable.h"
 #include "nsWrapperCache.h"
 #include "nsISupports.h"
 #include "mozilla/dom/WindowGlobalActor.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 
 class nsIPrincipal;
 class nsIURI;
 class nsFrameLoader;
 
 namespace mozilla {
+
+namespace gfx {
+class CrossProcessPaint;
+}  // namespace gfx
+
 namespace dom {
 
 class WindowGlobalChild;
 class JSWindowActorParent;
 class JSWindowActorMessageMeta;
 
 /**
  * A handle in the parent process to a specific nsGlobalWindowInner object.
  */
 class WindowGlobalParent final : public WindowGlobalActor,
                                  public PWindowGlobalParent {
+  friend class gfx::CrossProcessPaint;
   friend class PWindowGlobalParent;
 
  public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(WindowGlobalParent,
                                                          WindowGlobalActor)
 
   static already_AddRefed<WindowGlobalParent> GetByInnerWindowId(
@@ -102,27 +109,31 @@ class WindowGlobalParent final : public 
 
   bool IsInitialDocument() { return mIsInitialDocument; }
 
   already_AddRefed<Promise> ChangeFrameRemoteness(dom::BrowsingContext* aBc,
                                                   const nsAString& aRemoteType,
                                                   uint64_t aPendingSwitchId,
                                                   ErrorResult& aRv);
 
+  already_AddRefed<mozilla::dom::Promise> DrawSnapshot(
+      const DOMRect* aRect, double aScale, const nsAString& aBackgroundColor,
+      mozilla::ErrorResult& aRv);
+
   already_AddRefed<Promise> GetSecurityInfo(ErrorResult& aRv);
 
   // Create a WindowGlobalParent from over IPC. This method should not be called
   // from outside of the IPC constructors.
   WindowGlobalParent(const WindowGlobalInit& aInit, bool aInProcess);
 
   // Initialize the mFrameLoader fields for a created WindowGlobalParent. Must
   // be called after setting the Manager actor.
   void Init(const WindowGlobalInit& aInit);
 
-  nsISupports* GetParentObject();
+  nsIGlobalObject* GetParentObject();
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 
  protected:
   const nsAString& GetRemoteType() override;
   JSWindowActor::Type GetSide() override { return JSWindowActor::Type::Parent; }
 
   // IPC messages
@@ -135,16 +146,20 @@ class WindowGlobalParent final : public 
   mozilla::ipc::IPCResult RecvDestroy();
   mozilla::ipc::IPCResult RecvRawMessage(const JSWindowActorMessageMeta& aMeta,
                                          const ClonedMessageData& aData);
   mozilla::ipc::IPCResult RecvDidEmbedBrowsingContext(
       dom::BrowsingContext* aContext);
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
+  void DrawSnapshotInternal(gfx::CrossProcessPaint* aPaint,
+                            const Maybe<IntRect>& aRect, float aScale,
+                            nscolor aBackgroundColor);
+
  private:
   ~WindowGlobalParent();
 
   // NOTE: This document principal doesn't reflect possible |document.domain|
   // mutations which may have been made in the actual document.
   nsCOMPtr<nsIPrincipal> mDocumentPrincipal;
   nsCOMPtr<nsIURI> mDocumentURI;
   RefPtr<nsFrameLoader> mFrameLoader;
--- a/dom/media/gmp/GMPStorageChild.cpp
+++ b/dom/media/gmp/GMPStorageChild.cpp
@@ -197,17 +197,17 @@ mozilla::ipc::IPCResult GMPStorageChild:
     return IPC_OK();
   }
   record->OpenComplete(aStatus);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GMPStorageChild::RecvReadComplete(
     const nsCString& aRecordName, const GMPErr& aStatus,
-    InfallibleTArray<uint8_t>&& aBytes) {
+    nsTArray<uint8_t>&& aBytes) {
   if (mShutdown) {
     return IPC_OK();
   }
   RefPtr<GMPRecordImpl> record = GetRecord(aRecordName);
   if (!record) {
     // Not fatal.
     return IPC_OK();
   }
--- a/dom/media/gmp/GMPStorageChild.h
+++ b/dom/media/gmp/GMPStorageChild.h
@@ -73,17 +73,17 @@ class GMPStorageChild : public PGMPStora
  protected:
   ~GMPStorageChild() {}
 
   // PGMPStorageChild
   mozilla::ipc::IPCResult RecvOpenComplete(const nsCString& aRecordName,
                                            const GMPErr& aStatus);
   mozilla::ipc::IPCResult RecvReadComplete(const nsCString& aRecordName,
                                            const GMPErr& aStatus,
-                                           InfallibleTArray<uint8_t>&& aBytes);
+                                           nsTArray<uint8_t>&& aBytes);
   mozilla::ipc::IPCResult RecvWriteComplete(const nsCString& aRecordName,
                                             const GMPErr& aStatus);
   mozilla::ipc::IPCResult RecvShutdown();
 
  private:
   Monitor mMonitor;
   nsRefPtrHashtable<nsCStringHashKey, GMPRecordImpl> mRecords;
   GMPChild* mPlugin;
--- a/dom/media/gmp/GMPStorageParent.cpp
+++ b/dom/media/gmp/GMPStorageParent.cpp
@@ -119,17 +119,17 @@ mozilla::ipc::IPCResult GMPStorageParent
          this, aRecordName.get(), data.Length(), static_cast<uint32_t>(rv)));
     Unused << SendReadComplete(aRecordName, rv, data);
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GMPStorageParent::RecvWrite(
-    const nsCString& aRecordName, InfallibleTArray<uint8_t>&& aBytes) {
+    const nsCString& aRecordName, nsTArray<uint8_t>&& aBytes) {
   LOGD(("GMPStorageParent[%p]::RecvWrite(record='%s') %zu bytes", this,
         aRecordName.get(), aBytes.Length()));
 
   if (mShutdown) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   if (!mStorage->IsOpen(aRecordName)) {
--- a/dom/media/gmp/GMPStorageParent.h
+++ b/dom/media/gmp/GMPStorageParent.h
@@ -22,19 +22,18 @@ class GMPStorageParent : public PGMPStor
   GMPStorageParent(const nsCString& aNodeId, GMPParent* aPlugin);
 
   nsresult Init();
   void Shutdown();
 
  protected:
   mozilla::ipc::IPCResult RecvOpen(const nsCString& aRecordName) override;
   mozilla::ipc::IPCResult RecvRead(const nsCString& aRecordName) override;
-  mozilla::ipc::IPCResult RecvWrite(
-      const nsCString& aRecordName,
-      InfallibleTArray<uint8_t>&& aBytes) override;
+  mozilla::ipc::IPCResult RecvWrite(const nsCString& aRecordName,
+                                    nsTArray<uint8_t>&& aBytes) override;
   mozilla::ipc::IPCResult RecvClose(const nsCString& aRecordName) override;
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
  private:
   ~GMPStorageParent() {}
 
   RefPtr<GMPStorage> mStorage;
 
--- a/dom/media/gmp/GMPVideoDecoderChild.cpp
+++ b/dom/media/gmp/GMPVideoDecoderChild.cpp
@@ -85,33 +85,32 @@ void GMPVideoDecoderChild::ResetComplete
 
 void GMPVideoDecoderChild::Error(GMPErr aError) {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
   SendError(aError);
 }
 
 mozilla::ipc::IPCResult GMPVideoDecoderChild::RecvInitDecode(
-    const GMPVideoCodec& aCodecSettings,
-    InfallibleTArray<uint8_t>&& aCodecSpecific, const int32_t& aCoreCount) {
+    const GMPVideoCodec& aCodecSettings, nsTArray<uint8_t>&& aCodecSpecific,
+    const int32_t& aCoreCount) {
   if (!mVideoDecoder) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   // Ignore any return code. It is OK for this to fail without killing the
   // process.
   mVideoDecoder->InitDecode(aCodecSettings, aCodecSpecific.Elements(),
                             aCodecSpecific.Length(), this, aCoreCount);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GMPVideoDecoderChild::RecvDecode(
     const GMPVideoEncodedFrameData& aInputFrame, const bool& aMissingFrames,
-    InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
-    const int64_t& aRenderTimeMs) {
+    nsTArray<uint8_t>&& aCodecSpecificInfo, const int64_t& aRenderTimeMs) {
   if (!mVideoDecoder) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   auto f = new GMPVideoEncodedFrameImpl(aInputFrame, &mVideoHost);
 
   // Ignore any return code. It is OK for this to fail without killing the
   // process.
--- a/dom/media/gmp/GMPVideoDecoderChild.h
+++ b/dom/media/gmp/GMPVideoDecoderChild.h
@@ -44,23 +44,22 @@ class GMPVideoDecoderChild : public PGMP
   bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType,
              Shmem* aMem) override;
   void Dealloc(Shmem&& aMem) override;
 
  private:
   virtual ~GMPVideoDecoderChild();
 
   // PGMPVideoDecoderChild
-  mozilla::ipc::IPCResult RecvInitDecode(
-      const GMPVideoCodec& aCodecSettings,
-      InfallibleTArray<uint8_t>&& aCodecSpecific, const int32_t& aCoreCount);
+  mozilla::ipc::IPCResult RecvInitDecode(const GMPVideoCodec& aCodecSettings,
+                                         nsTArray<uint8_t>&& aCodecSpecific,
+                                         const int32_t& aCoreCount);
   mozilla::ipc::IPCResult RecvDecode(
       const GMPVideoEncodedFrameData& aInputFrame, const bool& aMissingFrames,
-      InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
-      const int64_t& aRenderTimeMs);
+      nsTArray<uint8_t>&& aCodecSpecificInfo, const int64_t& aRenderTimeMs);
   mozilla::ipc::IPCResult RecvChildShmemForPool(Shmem&& aFrameBuffer);
   mozilla::ipc::IPCResult RecvReset();
   mozilla::ipc::IPCResult RecvDrain();
   mozilla::ipc::IPCResult RecvDecodingComplete();
 
   GMPContentChild* mPlugin;
   GMPVideoDecoder* mVideoDecoder;
   GMPVideoHostImpl mVideoHost;
--- a/dom/media/gmp/GMPVideoEncoderChild.cpp
+++ b/dom/media/gmp/GMPVideoEncoderChild.cpp
@@ -55,36 +55,35 @@ void GMPVideoEncoderChild::Encoded(GMPVi
 
 void GMPVideoEncoderChild::Error(GMPErr aError) {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
   SendError(aError);
 }
 
 mozilla::ipc::IPCResult GMPVideoEncoderChild::RecvInitEncode(
-    const GMPVideoCodec& aCodecSettings,
-    InfallibleTArray<uint8_t>&& aCodecSpecific, const int32_t& aNumberOfCores,
-    const uint32_t& aMaxPayloadSize) {
+    const GMPVideoCodec& aCodecSettings, nsTArray<uint8_t>&& aCodecSpecific,
+    const int32_t& aNumberOfCores, const uint32_t& aMaxPayloadSize) {
   if (!mVideoEncoder) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   // Ignore any return code. It is OK for this to fail without killing the
   // process.
   mVideoEncoder->InitEncode(aCodecSettings, aCodecSpecific.Elements(),
                             aCodecSpecific.Length(), this, aNumberOfCores,
                             aMaxPayloadSize);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GMPVideoEncoderChild::RecvEncode(
     const GMPVideoi420FrameData& aInputFrame,
-    InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
-    InfallibleTArray<GMPVideoFrameType>&& aFrameTypes) {
+    nsTArray<uint8_t>&& aCodecSpecificInfo,
+    nsTArray<GMPVideoFrameType>&& aFrameTypes) {
   if (!mVideoEncoder) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   auto f = new GMPVideoi420FrameImpl(aInputFrame, &mVideoHost);
 
   // Ignore any return code. It is OK for this to fail without killing the
   // process.
--- a/dom/media/gmp/GMPVideoEncoderChild.h
+++ b/dom/media/gmp/GMPVideoEncoderChild.h
@@ -40,24 +40,23 @@ class GMPVideoEncoderChild : public PGMP
   bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType,
              Shmem* aMem) override;
   void Dealloc(Shmem&& aMem) override;
 
  private:
   virtual ~GMPVideoEncoderChild();
 
   // PGMPVideoEncoderChild
-  mozilla::ipc::IPCResult RecvInitEncode(
-      const GMPVideoCodec& aCodecSettings,
-      InfallibleTArray<uint8_t>&& aCodecSpecific, const int32_t& aNumberOfCores,
-      const uint32_t& aMaxPayloadSize);
-  mozilla::ipc::IPCResult RecvEncode(
-      const GMPVideoi420FrameData& aInputFrame,
-      InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
-      InfallibleTArray<GMPVideoFrameType>&& aFrameTypes);
+  mozilla::ipc::IPCResult RecvInitEncode(const GMPVideoCodec& aCodecSettings,
+                                         nsTArray<uint8_t>&& aCodecSpecific,
+                                         const int32_t& aNumberOfCores,
+                                         const uint32_t& aMaxPayloadSize);
+  mozilla::ipc::IPCResult RecvEncode(const GMPVideoi420FrameData& aInputFrame,
+                                     nsTArray<uint8_t>&& aCodecSpecificInfo,
+                                     nsTArray<GMPVideoFrameType>&& aFrameTypes);
   mozilla::ipc::IPCResult RecvChildShmemForPool(Shmem&& aEncodedBuffer);
   mozilla::ipc::IPCResult RecvSetChannelParameters(const uint32_t& aPacketLoss,
                                                    const uint32_t& aRTT);
   mozilla::ipc::IPCResult RecvSetRates(const uint32_t& aNewBitRate,
                                        const uint32_t& aFrameRate);
   mozilla::ipc::IPCResult RecvSetPeriodicKeyFrames(const bool& aEnable);
   mozilla::ipc::IPCResult RecvEncodingComplete();
 
--- a/dom/media/gmp/GMPVideoEncoderParent.cpp
+++ b/dom/media/gmp/GMPVideoEncoderParent.cpp
@@ -240,17 +240,17 @@ void GMPVideoEncoderParent::ActorDestroy
     mPlugin = nullptr;
   }
   mVideoHost.ActorDestroyed();  // same as DoneWithAPI
   MaybeDisconnect(aWhy == AbnormalShutdown);
 }
 
 mozilla::ipc::IPCResult GMPVideoEncoderParent::RecvEncoded(
     const GMPVideoEncodedFrameData& aEncodedFrame,
-    InfallibleTArray<uint8_t>&& aCodecSpecificInfo) {
+    nsTArray<uint8_t>&& aCodecSpecificInfo) {
   if (!mCallback) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   auto f = new GMPVideoEncodedFrameImpl(aEncodedFrame, &mVideoHost);
   // Ignore any return code. It is OK for this to fail without killing the
   // process. This can be called on any thread (or more than one)
   mCallback->Encoded(f, aCodecSpecificInfo);
--- a/dom/media/gmp/GMPVideoEncoderParent.h
+++ b/dom/media/gmp/GMPVideoEncoderParent.h
@@ -62,17 +62,17 @@ class GMPVideoEncoderParent : public GMP
 
  private:
   virtual ~GMPVideoEncoderParent(){};
 
   // PGMPVideoEncoderParent
   void ActorDestroy(ActorDestroyReason aWhy) override;
   mozilla::ipc::IPCResult RecvEncoded(
       const GMPVideoEncodedFrameData& aEncodedFrame,
-      InfallibleTArray<uint8_t>&& aCodecSpecificInfo) override;
+      nsTArray<uint8_t>&& aCodecSpecificInfo) override;
   mozilla::ipc::IPCResult RecvError(const GMPErr& aError) override;
   mozilla::ipc::IPCResult RecvShutdown() override;
   mozilla::ipc::IPCResult RecvParentShmemForPool(Shmem&& aFrameBuffer) override;
   mozilla::ipc::IPCResult AnswerNeedShmem(const uint32_t& aEncodedBufferSize,
                                           Shmem* aMem) override;
   mozilla::ipc::IPCResult Recv__delete__() override;
 
   bool mIsOpen;
--- a/dom/media/webaudio/ChannelMergerNode.h
+++ b/dom/media/webaudio/ChannelMergerNode.h
@@ -31,16 +31,30 @@ class ChannelMergerNode final : public A
 
   JSObject* WrapObject(JSContext* aCx,
                        JS::Handle<JSObject*> aGivenProto) override;
 
   uint16_t NumberOfInputs() const override { return mInputCount; }
 
   const char* NodeType() const override { return "ChannelMergerNode"; }
 
+  virtual void SetChannelCount(uint32_t aChannelCount,
+                               ErrorResult& aRv) override {
+    if (aChannelCount != 1) {
+      aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    }
+  }
+
+  virtual void SetChannelCountModeValue(ChannelCountMode aMode,
+                                        ErrorResult& aRv) override {
+    if (aMode != ChannelCountMode::Explicit) {
+      aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
+    }
+  }
+
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
  private:
   ChannelMergerNode(AudioContext* aContext, uint16_t aInputCount);
   ~ChannelMergerNode() = default;
 
--- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
+++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
@@ -30,17 +30,17 @@ using mozilla::intl::LocaleService;
 
 #undef LOG
 extern mozilla::LogModule* GetSpeechSynthLog();
 #define LOG(type, msg) MOZ_LOG(GetSpeechSynthLog(), type, msg)
 
 namespace {
 
 void GetAllSpeechSynthActors(
-    InfallibleTArray<mozilla::dom::SpeechSynthesisParent*>& aActors) {
+    nsTArray<mozilla::dom::SpeechSynthesisParent*>& aActors) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aActors.IsEmpty());
 
   AutoTArray<mozilla::dom::ContentParent*, 20> contentActors;
   mozilla::dom::ContentParent::GetAll(contentActors);
 
   for (uint32_t contentIndex = 0; contentIndex < contentActors.Length();
        ++contentIndex) {
@@ -182,18 +182,18 @@ nsSynthVoiceRegistry::GetInstanceForServ
 
   return registry.forget();
 }
 
 bool nsSynthVoiceRegistry::SendInitialVoicesAndState(
     SpeechSynthesisParent* aParent) {
   MOZ_ASSERT(XRE_IsParentProcess());
 
-  InfallibleTArray<RemoteVoice> voices;
-  InfallibleTArray<nsString> defaults;
+  nsTArray<RemoteVoice> voices;
+  nsTArray<nsString> defaults;
 
   for (uint32_t i = 0; i < mVoices.Length(); ++i) {
     RefPtr<VoiceData> voice = mVoices[i];
 
     voices.AppendElement(RemoteVoice(voice->mUri, voice->mName, voice->mLang,
                                      voice->mIsLocal, voice->mIsQueued));
   }
 
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -476,17 +476,17 @@ TCPSocket::FireEvent(const nsAString& aT
     return NS_ERROR_FAILURE;
   }
   JS::Rooted<JS::Value> val(api.cx());
   return FireDataEvent(api.cx(), aType, val);
 }
 
 NS_IMETHODIMP
 TCPSocket::FireDataArrayEvent(const nsAString& aType,
-                              const InfallibleTArray<uint8_t>& buffer) {
+                              const nsTArray<uint8_t>& buffer) {
   AutoJSAPI api;
   if (NS_WARN_IF(!api.Init(GetOwnerGlobal()))) {
     return NS_ERROR_FAILURE;
   }
   JSContext* cx = api.cx();
   JS::Rooted<JS::Value> val(cx);
 
   bool ok = IPC::DeserializeArrayBuffer(cx, buffer, &val);
--- a/dom/network/TCPSocketChild.cpp
+++ b/dom/network/TCPSocketChild.cpp
@@ -18,18 +18,17 @@
 #include "js/RootingAPI.h"   // JS::MutableHandle
 #include "js/Utility.h"  // js::ArrayBufferContentsArena, JS::FreePolicy, js_pod_arena_malloc
 #include "js/Value.h"  // JS::Value
 
 using mozilla::net::gNeckoChild;
 
 namespace IPC {
 
-bool DeserializeArrayBuffer(JSContext* cx,
-                            const InfallibleTArray<uint8_t>& aBuffer,
+bool DeserializeArrayBuffer(JSContext* cx, const nsTArray<uint8_t>& aBuffer,
                             JS::MutableHandle<JS::Value> aVal) {
   mozilla::UniquePtr<uint8_t[], JS::FreePolicy> data(
       js_pod_arena_malloc<uint8_t>(js::ArrayBufferContentsArena,
                                    aBuffer.Length()));
   if (!data) return false;
   memcpy(data.get(), aBuffer.Elements(), aBuffer.Length());
 
   JSObject* obj =
@@ -182,17 +181,17 @@ nsresult TCPSocketChild::SendSend(const 
   uint32_t offset = std::min(buflen, aByteOffset);
   uint32_t nbytes = std::min(buflen - aByteOffset, aByteLength);
   FallibleTArray<uint8_t> fallibleArr;
   if (!fallibleArr.InsertElementsAt(0, aData.Data() + offset, nbytes,
                                     fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  InfallibleTArray<uint8_t> arr;
+  nsTArray<uint8_t> arr;
   arr.SwapElements(fallibleArr);
   SendData(arr, aTrackingNumber);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TCPSocketChild::SendSendArray(nsTArray<uint8_t>& aArray,
                               uint32_t aTrackingNumber) {
--- a/dom/network/TCPSocketChild.h
+++ b/dom/network/TCPSocketChild.h
@@ -11,18 +11,17 @@
 #include "mozilla/net/PTCPSocketChild.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsCOMPtr.h"
 #include "js/TypeDecls.h"
 
 class nsITCPSocketCallback;
 
 namespace IPC {
-bool DeserializeArrayBuffer(JSContext* cx,
-                            const InfallibleTArray<uint8_t>& aBuffer,
+bool DeserializeArrayBuffer(JSContext* cx, const nsTArray<uint8_t>& aBuffer,
                             JS::MutableHandle<JS::Value> aVal);
 }
 
 namespace mozilla {
 namespace dom {
 
 class TCPSocket;
 
--- a/dom/network/TCPSocketParent.cpp
+++ b/dom/network/TCPSocketParent.cpp
@@ -18,17 +18,17 @@
 #include "nsISocketTransport.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsNetUtil.h"
 
 namespace IPC {
 
 // Defined in TCPSocketChild.cpp
 extern bool DeserializeArrayBuffer(JSContext* aCx,
-                                   const InfallibleTArray<uint8_t>& aBuffer,
+                                   const nsTArray<uint8_t>& aBuffer,
                                    JS::MutableHandle<JS::Value> aVal);
 
 }  // namespace IPC
 
 namespace mozilla {
 
 namespace net {
 //
@@ -203,17 +203,17 @@ mozilla::ipc::IPCResult TCPSocketParent:
     const SendableData& aData, const uint32_t& aTrackingNumber) {
   ErrorResult rv;
 
   if (mFilter) {
     mozilla::net::NetAddr addr;  // dummy value
     bool allowed;
     MOZ_ASSERT(aData.type() == SendableData::TArrayOfuint8_t,
                "Unsupported data type for filtering");
-    const InfallibleTArray<uint8_t>& data(aData.get_ArrayOfuint8_t());
+    const nsTArray<uint8_t>& data(aData.get_ArrayOfuint8_t());
     nsresult nsrv =
         mFilter->FilterPacket(&addr, data.Elements(), data.Length(),
                               nsISocketFilter::SF_OUTGOING, &allowed);
 
     // Reject sending of unallowed data
     if (NS_WARN_IF(NS_FAILED(nsrv)) || !allowed) {
       TCPSOCKET_LOG(("%s: Dropping outgoing TCP packet", __FUNCTION__));
       return IPC_FAIL_NO_REASON(this);
@@ -266,17 +266,17 @@ void TCPSocketParent::FireErrorEvent(con
 
 void TCPSocketParent::FireEvent(const nsAString& aType,
                                 TCPReadyState aReadyState) {
   return SendEvent(aType, mozilla::void_t(), aReadyState);
 }
 
 void TCPSocketParent::FireArrayBufferDataEvent(nsTArray<uint8_t>& aBuffer,
                                                TCPReadyState aReadyState) {
-  InfallibleTArray<uint8_t> arr;
+  nsTArray<uint8_t> arr;
   arr.SwapElements(aBuffer);
 
   if (mFilter) {
     bool allowed;
     mozilla::net::NetAddr addr;
     nsresult nsrv =
         mFilter->FilterPacket(&addr, arr.Elements(), arr.Length(),
                               nsISocketFilter::SF_INCOMING, &allowed);
--- a/dom/network/UDPSocketChild.cpp
+++ b/dom/network/UDPSocketChild.cpp
@@ -131,17 +131,17 @@ nsresult UDPSocketChild::SendDataInterna
                                           const uint32_t aByteLength) {
   NS_ENSURE_ARG(aData);
 
   FallibleTArray<uint8_t> fallibleArray;
   if (!fallibleArray.InsertElementsAt(0, aData, aByteLength, fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  InfallibleTArray<uint8_t> array;
+  nsTArray<uint8_t> array;
   array.SwapElements(fallibleArray);
 
   SendOutgoingData(array, aAddr);
 
   return NS_OK;
 }
 
 nsresult UDPSocketChild::SendBinaryStream(const nsACString& aHost,
@@ -209,17 +209,17 @@ mozilla::ipc::IPCResult UDPSocketChild::
 mozilla::ipc::IPCResult UDPSocketChild::RecvCallbackClosed() {
   nsresult rv = mSocket->CallListenerClosed();
   mozilla::Unused << NS_WARN_IF(NS_FAILED(rv));
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult UDPSocketChild::RecvCallbackReceivedData(
-    const UDPAddressInfo& aAddressInfo, InfallibleTArray<uint8_t>&& aData) {
+    const UDPAddressInfo& aAddressInfo, nsTArray<uint8_t>&& aData) {
   UDPSOCKET_LOG(("%s: %s:%u length %zu", __FUNCTION__,
                  aAddressInfo.addr().get(), aAddressInfo.port(),
                  aData.Length()));
   nsresult rv = mSocket->CallListenerReceivedData(aAddressInfo.addr(),
                                                   aAddressInfo.port(), aData);
   mozilla::Unused << NS_WARN_IF(NS_FAILED(rv));
 
   return IPC_OK();
--- a/dom/network/UDPSocketChild.h
+++ b/dom/network/UDPSocketChild.h
@@ -83,17 +83,17 @@ class UDPSocketChild : public mozilla::n
                       const nsACString& aInterface);
 
   mozilla::ipc::IPCResult RecvCallbackOpened(
       const UDPAddressInfo& aAddressInfo);
   mozilla::ipc::IPCResult RecvCallbackConnected(
       const UDPAddressInfo& aAddressInfo);
   mozilla::ipc::IPCResult RecvCallbackClosed();
   mozilla::ipc::IPCResult RecvCallbackReceivedData(
-      const UDPAddressInfo& aAddressInfo, InfallibleTArray<uint8_t>&& aData);
+      const UDPAddressInfo& aAddressInfo, nsTArray<uint8_t>&& aData);
   mozilla::ipc::IPCResult RecvCallbackError(const nsCString& aMessage,
                                             const nsCString& aFilename,
                                             const uint32_t& aLineNumber);
 
  private:
   nsresult SendDataInternal(const UDPSocketAddr& aAddr, const uint8_t* aData,
                             const uint32_t aByteLength);
 
--- a/dom/network/UDPSocketParent.cpp
+++ b/dom/network/UDPSocketParent.cpp
@@ -335,17 +335,17 @@ mozilla::ipc::IPCResult UDPSocketParent:
     }
 
     // TODO, Packet filter doesn't support input stream yet.
     if (aData.type() != UDPData::TArrayOfuint8_t) {
       return IPC_OK();
     }
 
     bool allowed;
-    const InfallibleTArray<uint8_t>& data(aData.get_ArrayOfuint8_t());
+    const nsTArray<uint8_t>& data(aData.get_ArrayOfuint8_t());
     rv = mFilter->FilterPacket(&aAddr.get_NetAddr(), data.Elements(),
                                data.Length(), nsISocketFilter::SF_OUTGOING,
                                &allowed);
 
     // Sending unallowed data, kill content.
     if (NS_WARN_IF(NS_FAILED(rv)) || !allowed) {
       return IPC_FAIL(this, "Content tried to send non STUN packet");
     }
@@ -361,17 +361,17 @@ mozilla::ipc::IPCResult UDPSocketParent:
     default:
       MOZ_ASSERT(false, "Invalid data type!");
       return IPC_OK();
   }
 
   return IPC_OK();
 }
 
-void UDPSocketParent::Send(const InfallibleTArray<uint8_t>& aData,
+void UDPSocketParent::Send(const nsTArray<uint8_t>& aData,
                            const UDPSocketAddr& aAddr) {
   nsresult rv;
   uint32_t count;
   switch (aAddr.type()) {
     case UDPSocketAddr::TUDPAddressInfo: {
       const UDPAddressInfo& addrInfo(aAddr.get_UDPAddressInfo());
       rv = mSocket->Send(addrInfo.addr(), addrInfo.port(), aData, &count);
       break;
@@ -522,17 +522,17 @@ UDPSocketParent::OnPacketReceived(nsIUDP
     }
   }
 
   FallibleTArray<uint8_t> fallibleArray;
   if (!fallibleArray.InsertElementsAt(0, buffer, len, fallible)) {
     FireInternalError(__LINE__);
     return NS_ERROR_OUT_OF_MEMORY;
   }
-  InfallibleTArray<uint8_t> infallibleArray;
+  nsTArray<uint8_t> infallibleArray;
   infallibleArray.SwapElements(fallibleArray);
 
   // compose callback
   mozilla::Unused << SendCallbackReceivedData(UDPAddressInfo(ip, port),
                                               infallibleArray);
 
   return NS_OK;
 }
--- a/dom/network/UDPSocketParent.h
+++ b/dom/network/UDPSocketParent.h
@@ -53,17 +53,17 @@ class UDPSocketParent : public mozilla::
                                             const nsCString& aInterface);
   mozilla::ipc::IPCResult RecvLeaveMulticast(const nsCString& aMulticastAddress,
                                              const nsCString& aInterface);
 
  private:
   virtual ~UDPSocketParent();
 
   virtual void ActorDestroy(ActorDestroyReason why) override;
-  void Send(const InfallibleTArray<uint8_t>& aData, const UDPSocketAddr& aAddr);
+  void Send(const nsTArray<uint8_t>& aData, const UDPSocketAddr& aAddr);
   void Send(const IPCStream& aStream, const UDPSocketAddr& aAddr);
   nsresult BindInternal(const nsCString& aHost, const uint16_t& aPort,
                         const bool& aAddressReuse, const bool& aLoopback,
                         const uint32_t& recvBufferSize,
                         const uint32_t& sendBufferSize);
   nsresult ConnectInternal(const nsCString& aHost, const uint16_t& aPort);
   void FireInternalError(uint32_t aLineNo);
   void SendInternalError(nsIEventTarget* aThread, uint32_t aLineNo);
--- a/dom/network/interfaces/nsITCPSocketCallback.idl
+++ b/dom/network/interfaces/nsITCPSocketCallback.idl
@@ -9,17 +9,17 @@
  * event handler based interface.
  */
 
 #include "domstubs.idl"
 
 %{C++
 #include "nsTArrayForwardDeclare.h"
 %}
-[ref] native nsUint8TArrayRef(InfallibleTArray<uint8_t>);
+[ref] native nsUint8TArrayRef(nsTArray<uint8_t>);
 [ptr] native JSContextPtr(JSContext);
 
 
 /*
  * This interface is implemented in TCPSocket.cpp as an internal interface
  * for use in cross-process socket implementation.
  * Needed to account for multiple possible types that can be provided to
  * the socket callbacks as arguments.
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1100,17 +1100,17 @@ nsPluginHost::GetPluginTags(nsTArray<Ref
   for (nsIInternalPluginTag* plugin : mFakePlugins) {
     aResults.AppendElement(plugin);
   }
 
   return NS_OK;
 }
 
 nsPluginTag* nsPluginHost::FindPreferredPlugin(
-    const InfallibleTArray<nsPluginTag*>& matches) {
+    const nsTArray<nsPluginTag*>& matches) {
   // We prefer the plugin with the highest version number.
   /// XXX(johns): This seems to assume the only time multiple plugins will have
   ///             the same MIME type is if they're multiple versions of the same
   ///             plugin -- but since plugin filenames and pretty names can both
   ///             update, it's probably less arbitrary than just going at it
   ///             alphabetically.
 
   if (matches.IsEmpty()) {
@@ -1174,17 +1174,17 @@ nsPluginTag* nsPluginHost::FindNativePlu
   // As of FF 52, we only support flash and test plugins, so if the mime types
   // don't match for that, exit before we start loading plugins.
   if (!nsPluginHost::CanUsePluginForMIMEType(aMimeType)) {
     return nullptr;
   }
 
   LoadPlugins();
 
-  InfallibleTArray<nsPluginTag*> matchingPlugins;
+  nsTArray<nsPluginTag*> matchingPlugins;
 
   nsPluginTag* plugin = mPlugins;
   while (plugin) {
     if ((!aCheckEnabled || plugin->IsActive()) &&
         plugin->HasMimeType(aMimeType)) {
       matchingPlugins.AppendElement(plugin);
     }
     plugin = plugin->mNext;
@@ -1197,17 +1197,17 @@ nsPluginTag* nsPluginHost::FindNativePlu
     const nsACString& aExtension,
     /* out */ nsACString& aMimeType, bool aCheckEnabled) {
   if (aExtension.IsEmpty()) {
     return nullptr;
   }
 
   LoadPlugins();
 
-  InfallibleTArray<nsPluginTag*> matchingPlugins;
+  nsTArray<nsPluginTag*> matchingPlugins;
   nsCString matchingMime;  // Don't mutate aMimeType unless returning a match
   nsPluginTag* plugin = mPlugins;
 
   while (plugin) {
     if (!aCheckEnabled || plugin->IsActive()) {
       if (plugin->HasExtension(aExtension, matchingMime)) {
         matchingPlugins.AppendElement(plugin);
       }
@@ -1375,19 +1375,20 @@ nsresult nsPluginHost::NormalizeHostname
 
   return mIDNService->ConvertUTF8toACE(host, host);
 }
 
 // Enumerate a 'sites' array returned by GetSitesWithData and determine if
 // any of them have a base domain in common with 'domain'; if so, append them
 // to the 'result' array. If 'firstMatchOnly' is true, return after finding the
 // first match.
-nsresult nsPluginHost::EnumerateSiteData(
-    const nsACString& domain, const InfallibleTArray<nsCString>& sites,
-    InfallibleTArray<nsCString>& result, bool firstMatchOnly) {
+nsresult nsPluginHost::EnumerateSiteData(const nsACString& domain,
+                                         const nsTArray<nsCString>& sites,
+                                         nsTArray<nsCString>& result,
+                                         bool firstMatchOnly) {
   NS_ASSERTION(!domain.IsVoid(), "null domain string");
 
   nsresult rv;
   if (!mTLDService) {
     mTLDService = do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
@@ -1600,26 +1601,26 @@ class ClearDataFromSitesClosure : public
       callback->Callback(rv);
       return NS_OK;
     }
     return NS_OK;
   }
 
   // Callback from NPP_GetSitesWithData, kick the iteration off to clear the
   // data
-  NS_IMETHOD SitesWithData(InfallibleTArray<nsCString>& sites) override {
+  NS_IMETHOD SitesWithData(nsTArray<nsCString>& sites) override {
     // Enumerate the sites and build a list of matches.
     nsresult rv = host->EnumerateSiteData(domain, sites, matches, false);
     Callback(rv);
     return NS_OK;
   }
 
   nsCString domain;
   nsCOMPtr<nsIClearSiteDataCallback> callback;
-  InfallibleTArray<nsCString> matches;
+  nsTArray<nsCString> matches;
   nsIPluginTag* tag;
   uint64_t flags;
   int64_t maxAge;
   nsPluginHost* host;
   NS_DECLARE_STATIC_IID_ACCESSOR(ClearDataFromSitesClosure_CID)
  private:
   virtual ~ClearDataFromSitesClosure() = default;
 };
@@ -1696,38 +1697,38 @@ class GetSitesClosure : public nsIGetSit
   NS_DECL_ISUPPORTS
   GetSitesClosure(const nsACString& domain, nsPluginHost* host)
       : domain(domain),
         host(host),
         result{false},
         keepWaiting(true),
         retVal(NS_ERROR_NOT_INITIALIZED) {}
 
-  NS_IMETHOD SitesWithData(InfallibleTArray<nsCString>& sites) override {
+  NS_IMETHOD SitesWithData(nsTArray<nsCString>& sites) override {
     retVal = HandleGetSites(sites);
     keepWaiting = false;
     return NS_OK;
   }
 
-  nsresult HandleGetSites(InfallibleTArray<nsCString>& sites) {
+  nsresult HandleGetSites(nsTArray<nsCString>& sites) {
     // If there's no data, we're done.
     if (sites.IsEmpty()) {
       result = false;
       return NS_OK;
     }
 
     // If 'domain' is the null string, and there's data for at least one site,
     // we're done.
     if (domain.IsVoid()) {
       result = true;
       return NS_OK;
     }
 
     // Enumerate the sites and determine if there's a match.
-    InfallibleTArray<nsCString> matches;
+    nsTArray<nsCString> matches;
     nsresult rv = host->EnumerateSiteData(domain, sites, matches, true);
     NS_ENSURE_SUCCESS(rv, rv);
 
     result = !matches.IsEmpty();
     return NS_OK;
   }
 
   nsCString domain;
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -229,19 +229,18 @@ class nsPluginHost final : public nsIPlu
 
   nsresult NewPluginStreamListener(nsIURI* aURL,
                                    nsNPAPIPluginInstance* aInstance,
                                    nsIStreamListener** aStreamListener);
 
   void CreateWidget(nsPluginInstanceOwner* aOwner);
 
   nsresult EnumerateSiteData(const nsACString& domain,
-                             const InfallibleTArray<nsCString>& sites,
-                             InfallibleTArray<nsCString>& result,
-                             bool firstMatchOnly);
+                             const nsTArray<nsCString>& sites,
+                             nsTArray<nsCString>& result, bool firstMatchOnly);
 
   nsresult SendPluginsToContent();
   nsresult SetPluginsInContent(
       uint32_t aPluginEpoch, nsTArray<mozilla::plugins::PluginTag>& aPlugins,
       nsTArray<mozilla::plugins::FakePluginTag>& aFakePlugins);
 
  private:
   friend class nsPluginUnloadRunnable;
@@ -252,18 +251,17 @@ class nsPluginHost final : public nsIPlu
   // Writes updated plugins settings to disk and unloads the plugin
   // if it is now disabled. Should only be called by the plugin tag in question
   void UpdatePluginInfo(nsPluginTag* aPluginTag);
 
   nsresult TrySetUpPluginInstance(const nsACString& aMimeType, nsIURI* aURL,
                                   nsPluginInstanceOwner* aOwner);
 
   // FIXME-jsplugins comment here about when things may be fake
-  nsPluginTag* FindPreferredPlugin(
-      const InfallibleTArray<nsPluginTag*>& matches);
+  nsPluginTag* FindPreferredPlugin(const nsTArray<nsPluginTag*>& matches);
 
   // Find a plugin for the given type.  If aIncludeFake is true a fake plugin
   // will be preferred if one exists; otherwise a fake plugin will never be
   // returned.  If aCheckEnabled is false, disabled plugins can be returned.
   nsIInternalPluginTag* FindPluginForType(const nsACString& aMimeType,
                                           bool aIncludeFake,
                                           bool aCheckEnabled);
 
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -115,20 +115,20 @@ static RefPtr<DrawTarget> CreateDrawTarg
   if (!drawTarget) {
     MOZ_CRASH("CreateDrawTargetForSurface failed in plugin");
   }
   return drawTarget;
 }
 
 bool PluginInstanceChild::sIsIMEComposing = false;
 
-PluginInstanceChild::PluginInstanceChild(
-    const NPPluginFuncs* aPluginIface, const nsCString& aMimeType,
-    const InfallibleTArray<nsCString>& aNames,
-    const InfallibleTArray<nsCString>& aValues)
+PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface,
+                                         const nsCString& aMimeType,
+                                         const nsTArray<nsCString>& aNames,
+                                         const nsTArray<nsCString>& aValues)
     : mPluginIface(aPluginIface),
       mMimeType(aMimeType),
       mNames(aNames),
       mValues(aValues)
 #if defined(XP_DARWIN) || defined(XP_WIN)
       ,
       mContentsScaleFactor(1.0)
 #endif
@@ -2496,17 +2496,17 @@ PluginScriptableObjectChild* PluginInsta
 }
 
 void PluginInstanceChild::NPN_URLRedirectResponse(void* notifyData,
                                                   NPBool allow) {
   if (!notifyData) {
     return;
   }
 
-  InfallibleTArray<PStreamNotifyChild*> notifyStreams;
+  nsTArray<PStreamNotifyChild*> notifyStreams;
   ManagedPStreamNotifyChild(notifyStreams);
   uint32_t notifyStreamCount = notifyStreams.Length();
   for (uint32_t i = 0; i < notifyStreamCount; i++) {
     StreamNotifyChild* sn = static_cast<StreamNotifyChild*>(notifyStreams[i]);
     if (sn->mClosure == notifyData) {
       sn->SendRedirectNotifyResponse(static_cast<bool>(allow));
       return;
     }
@@ -3954,17 +3954,17 @@ void PluginInstanceChild::Destroy() {
     MOZ_CRASH("Destroying plugin instance on the stack.");
   }
   mDestroyed = true;
 
 #if defined(OS_WIN)
   SetProp(mPluginWindowHWND, kPluginIgnoreSubclassProperty, (HANDLE)1);
 #endif
 
-  InfallibleTArray<PBrowserStreamChild*> streams;
+  nsTArray<PBrowserStreamChild*> streams;
   ManagedPBrowserStreamChild(streams);
 
   // First make sure none of these streams become deleted
   for (uint32_t i = 0; i < streams.Length();) {
     if (static_cast<BrowserStreamChild*>(streams[i])->InstanceDying())
       ++i;
     else
       streams.RemoveElementAt(i);
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
@@ -161,18 +161,18 @@ class PluginInstanceChild : public PPlug
 
   mozilla::ipc::IPCResult AnswerUpdateWindow();
 
   mozilla::ipc::IPCResult RecvNPP_DidComposite();
 
  public:
   PluginInstanceChild(const NPPluginFuncs* aPluginIface,
                       const nsCString& aMimeType,
-                      const InfallibleTArray<nsCString>& aNames,
-                      const InfallibleTArray<nsCString>& aValues);
+                      const nsTArray<nsCString>& aNames,
+                      const nsTArray<nsCString>& aValues);
 
   virtual ~PluginInstanceChild();
 
   NPError DoNPP_New();
 
   // Common sync+async implementation of NPP_NewStream
   NPError DoNPP_NewStream(BrowserStreamChild* actor, const nsCString& mimeType,
                           const bool& seekable, uint16_t* stype);
@@ -315,18 +315,18 @@ class PluginInstanceChild : public PPlug
     bool mWindowed;
   };
 
   bool ShouldPostKeyMessage(UINT message, WPARAM wParam, LPARAM lParam);
   bool MaybePostKeyMessage(UINT message, WPARAM wParam, LPARAM lParam);
 #endif  // #if defined(OS_WIN)
   const NPPluginFuncs* mPluginIface;
   nsCString mMimeType;
-  InfallibleTArray<nsCString> mNames;
-  InfallibleTArray<nsCString> mValues;
+  nsTArray<nsCString> mNames;
+  nsTArray<nsCString> mValues;
   NPP_t mData;
   NPWindow mWindow;
 #if defined(XP_DARWIN) || defined(XP_WIN)
   double mContentsScaleFactor;
 #endif
   double mCSSZoomFactor;
   uint32_t mPostingKeyEvents;
   uint32_t mPostingKeyEventsOutdated;
--- a/dom/plugins/ipc/PluginLibrary.h
+++ b/dom/plugins/ipc/PluginLibrary.h
@@ -35,17 +35,17 @@ class nsIClearSiteDataCallback;
 #define nsIGetSitesWithDataCallback_CID              \
   {                                                  \
     0xd0028b83, 0xfdf9, 0x4c53, {                    \
       0xb7, 0xbb, 0x47, 0x46, 0x0f, 0x6b, 0x83, 0x6c \
     }                                                \
   }
 class nsIGetSitesWithDataCallback : public nsISupports {
  public:
-  NS_IMETHOD SitesWithData(InfallibleTArray<nsCString>& result) = 0;
+  NS_IMETHOD SitesWithData(nsTArray<nsCString>& result) = 0;
   NS_DECLARE_STATIC_IID_ACCESSOR(nsIGetSitesWithDataCallback_CID)
 };
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIGetSitesWithDataCallback,
                               nsIGetSitesWithDataCallback_CID)
 
 namespace mozilla {
 
 class PluginLibrary {
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -655,17 +655,17 @@ mozilla::ipc::IPCResult PluginModuleChil
       mFunctions.clearsitedata(NullableStringGet(aSite), aFlags, aMaxAge);
   SendReturnClearSiteData(result, aCallbackId);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginModuleChild::RecvNPP_GetSitesWithData(
     const uint64_t& aCallbackId) {
   char** result = mFunctions.getsiteswithdata();
-  InfallibleTArray<nsCString> array;
+  nsTArray<nsCString> array;
   if (!result) {
     SendReturnSitesWithData(array, aCallbackId);
     return IPC_OK();
   }
   char** iterator = result;
   while (*iterator) {
     array.AppendElement(*iterator);
     free(*iterator);
@@ -1577,18 +1577,18 @@ NPError PluginModuleChild::DoNP_Initiali
 #else
 #  error Please implement me for your platform
 #endif
 
   return result;
 }
 
 PPluginInstanceChild* PluginModuleChild::AllocPPluginInstanceChild(
-    const nsCString& aMimeType, const InfallibleTArray<nsCString>& aNames,
-    const InfallibleTArray<nsCString>& aValues) {
+    const nsCString& aMimeType, const nsTArray<nsCString>& aNames,
+    const nsTArray<nsCString>& aValues) {
   PLUGIN_LOG_DEBUG_METHOD;
   AssertPluginThread();
 
   // In e10s, gChromeInstance hands out quirks to instances, but never
   // allocates an instance on its own. Make sure it gets the latest copy
   // of quirks once we have them. Also note, with process-per-tab, we may
   // have multiple PluginModuleChilds in the same plugin process, so only
   // initialize this once in gChromeInstance, which is a singleton.
@@ -1618,18 +1618,17 @@ mozilla::ipc::IPCResult PluginModuleChil
 #else
   MOZ_ASSERT_UNREACHABLE("Shouldn't get here!");
   return IPC_FAIL_NO_REASON(this);
 #endif
 }
 
 mozilla::ipc::IPCResult PluginModuleChild::RecvPPluginInstanceConstructor(
     PPluginInstanceChild* aActor, const nsCString& aMimeType,
-    InfallibleTArray<nsCString>&& aNames,
-    InfallibleTArray<nsCString>&& aValues) {
+    nsTArray<nsCString>&& aNames, nsTArray<nsCString>&& aValues) {
   PLUGIN_LOG_DEBUG_METHOD;
   AssertPluginThread();
 
   NS_ASSERTION(aActor, "Null actor!");
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginModuleChild::AnswerSyncNPP_New(
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -65,25 +65,24 @@ class PluginModuleChild : public PPlugin
 
   mozilla::ipc::IPCResult RecvInitPluginModuleChild(
       Endpoint<PPluginModuleChild>&& endpoint);
 
   mozilla::ipc::IPCResult RecvInitPluginFunctionBroker(
       Endpoint<PFunctionBrokerChild>&& endpoint);
 
   PPluginInstanceChild* AllocPPluginInstanceChild(
-      const nsCString& aMimeType, const InfallibleTArray<nsCString>& aNames,
-      const InfallibleTArray<nsCString>& aValues);
+      const nsCString& aMimeType, const nsTArray<nsCString>& aNames,
+      const nsTArray<nsCString>& aValues);
 
   bool DeallocPPluginInstanceChild(PPluginInstanceChild* aActor);
 
   mozilla::ipc::IPCResult RecvPPluginInstanceConstructor(
       PPluginInstanceChild* aActor, const nsCString& aMimeType,
-      InfallibleTArray<nsCString>&& aNames,
-      InfallibleTArray<nsCString>&& aValues) override;
+      nsTArray<nsCString>&& aNames, nsTArray<nsCString>&& aValues) override;
   mozilla::ipc::IPCResult AnswerNP_Shutdown(NPError* rv);
 
   mozilla::ipc::IPCResult AnswerOptionalFunctionsSupported(
       bool* aURLRedirectNotify, bool* aClearSiteData, bool* aGetSitesWithData);
 
   mozilla::ipc::IPCResult RecvNPP_ClearSiteData(const nsCString& aSite,
                                                 const uint64_t& aFlags,
                                                 const uint64_t& aMaxAge,
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -790,20 +790,19 @@ uint64_t FileTimeToUTC(const FILETIME& f
   return li.QuadPart;
 }
 
 struct CpuUsageSamples {
   uint64_t sampleTimes[2];
   uint64_t cpuTimes[2];
 };
 
-bool GetProcessCpuUsage(
-    const InfallibleTArray<base::ProcessHandle>& processHandles,
-    InfallibleTArray<float>& cpuUsage) {
-  InfallibleTArray<CpuUsageSamples> samples(processHandles.Length());
+bool GetProcessCpuUsage(const nsTArray<base::ProcessHandle>& processHandles,
+                        nsTArray<float>& cpuUsage) {
+  nsTArray<CpuUsageSamples> samples(processHandles.Length());
   FILETIME creationTime, exitTime, kernelTime, userTime, currentTime;
   BOOL res;
 
   for (uint32_t i = 0; i < processHandles.Length(); ++i) {
     ::GetSystemTimeAsFileTime(&currentTime);
     res = ::GetProcessTimes(processHandles[i], &creationTime, &exitTime,
                             &kernelTime, &userTime);
     if (!res) {
@@ -1108,17 +1107,17 @@ void PluginModuleChromeParent::Terminate
 
   mozilla::ipc::ScopedProcessHandle geckoChildProcess;
   bool childOpened =
       base::OpenProcessHandle(OtherPid(), &geckoChildProcess.rwget());
 
 #ifdef XP_WIN
   // collect cpu usage for plugin processes
 
-  InfallibleTArray<base::ProcessHandle> processHandles;
+  nsTArray<base::ProcessHandle> processHandles;
 
   if (childOpened) {
     processHandles.AppendElement(geckoChildProcess);
   }
 
 #  ifdef MOZ_CRASHREPORTER_INJECTOR
   mozilla::ipc::ScopedProcessHandle flashBrokerProcess;
   if (mFlashProcess1 &&
@@ -1423,18 +1422,18 @@ void PluginModuleParent::NotifyPluginCra
   if (mCrashReporter && mCrashReporter->HasMinidump()) {
     dumpID = mCrashReporter->MinidumpID();
   }
 
   mPlugin->PluginCrashed(dumpID, browserDumpID);
 }
 
 PPluginInstanceParent* PluginModuleParent::AllocPPluginInstanceParent(
-    const nsCString& aMimeType, const InfallibleTArray<nsCString>& aNames,
-    const InfallibleTArray<nsCString>& aValues) {
+    const nsCString& aMimeType, const nsTArray<nsCString>& aNames,
+    const nsTArray<nsCString>& aValues) {
   NS_ERROR("Not reachable!");
   return nullptr;
 }
 
 bool PluginModuleParent::DeallocPPluginInstanceParent(
     PPluginInstanceParent* aActor) {
   PLUGIN_LOG_DEBUG_METHOD;
   delete aActor;
@@ -1998,18 +1997,18 @@ nsresult PluginModuleParent::NPP_New(NPM
   PLUGIN_LOG_DEBUG_METHOD;
 
   if (mShutdown) {
     *error = NPERR_GENERIC_ERROR;
     return NS_ERROR_FAILURE;
   }
 
   // create the instance on the other side
-  InfallibleTArray<nsCString> names;
-  InfallibleTArray<nsCString> values;
+  nsTArray<nsCString> names;
+  nsTArray<nsCString> values;
 
   for (int i = 0; i < argc; ++i) {
     names.AppendElement(NullableString(argn[i]));
     values.AppendElement(NullableString(argv[i]));
   }
 
   return NPP_NewInternal(pluginType, instance, names, values, saved, error);
 }
@@ -2018,53 +2017,53 @@ class nsCaseInsensitiveUTF8StringArrayCo
  public:
   template <class A, class B>
   bool Equals(const A& a, const B& b) const {
     return a.Equals(b.get(), nsCaseInsensitiveUTF8StringComparator());
   }
 };
 
 #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
-static void ForceWindowless(InfallibleTArray<nsCString>& names,
-                            InfallibleTArray<nsCString>& values) {
+static void ForceWindowless(nsTArray<nsCString>& names,
+                            nsTArray<nsCString>& values) {
   nsCaseInsensitiveUTF8StringArrayComparator comparator;
   NS_NAMED_LITERAL_CSTRING(wmodeAttributeName, "wmode");
   NS_NAMED_LITERAL_CSTRING(opaqueAttributeValue, "opaque");
   auto wmodeAttributeIndex = names.IndexOf(wmodeAttributeName, 0, comparator);
   if (wmodeAttributeIndex != names.NoIndex) {
     if (!values[wmodeAttributeIndex].EqualsLiteral("transparent")) {
       values[wmodeAttributeIndex].Assign(opaqueAttributeValue);
     }
   } else {
     names.AppendElement(wmodeAttributeName);
     values.AppendElement(opaqueAttributeValue);
   }
 }
 #endif  // windows or linux
 #if defined(XP_WIN)
-static void ForceDirect(InfallibleTArray<nsCString>& names,
-                        InfallibleTArray<nsCString>& values) {
+static void ForceDirect(nsTArray<nsCString>& names,
+                        nsTArray<nsCString>& values) {
   nsCaseInsensitiveUTF8StringArrayComparator comparator;
   NS_NAMED_LITERAL_CSTRING(wmodeAttributeName, "wmode");
   NS_NAMED_LITERAL_CSTRING(directAttributeValue, "direct");
   auto wmodeAttributeIndex = names.IndexOf(wmodeAttributeName, 0, comparator);
   if (wmodeAttributeIndex != names.NoIndex) {
     if (values[wmodeAttributeIndex].EqualsLiteral("window")) {
       values[wmodeAttributeIndex].Assign(directAttributeValue);
     }
   } else {
     names.AppendElement(wmodeAttributeName);
     values.AppendElement(directAttributeValue);
   }
 }
 #endif  // windows
 
 nsresult PluginModuleParent::NPP_NewInternal(
-    NPMIMEType pluginType, NPP instance, InfallibleTArray<nsCString>& names,
-    InfallibleTArray<nsCString>& values, NPSavedData* saved, NPError* error) {
+    NPMIMEType pluginType, NPP instance, nsTArray<nsCString>& names,
+    nsTArray<nsCString>& values, NPSavedData* saved, NPError* error) {
   MOZ_ASSERT(names.Length() == values.Length());
   if (mPluginName.IsEmpty()) {
     GetPluginDetails();
     InitQuirksModes(nsDependentCString(pluginType));
   }
 
   nsCaseInsensitiveUTF8StringArrayComparator comparator;
   NS_NAMED_LITERAL_CSTRING(srcAttributeName, "src");
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -78,18 +78,18 @@ class PluginModuleParent : public PPlugi
 #endif
 {
   friend class PPluginModuleParent;
 
  protected:
   typedef mozilla::PluginLibrary PluginLibrary;
 
   PPluginInstanceParent* AllocPPluginInstanceParent(
-      const nsCString& aMimeType, const InfallibleTArray<nsCString>& aNames,
-      const InfallibleTArray<nsCString>& aValues);
+      const nsCString& aMimeType, const nsTArray<nsCString>& aNames,
+      const nsTArray<nsCString>& aValues);
 
   bool DeallocPPluginInstanceParent(PPluginInstanceParent* aActor);
 
  public:
   explicit PluginModuleParent(bool aIsChrome);
   virtual ~PluginModuleParent();
 
   bool IsChrome() const { return mIsChrome; }
@@ -160,19 +160,19 @@ class PluginModuleParent : public PPlugi
                                                   const uint64_t& aCallbackId);
 
   mozilla::ipc::IPCResult RecvReturnSitesWithData(nsTArray<nsCString>&& aSites,
                                                   const uint64_t& aCallbackId);
 
   void SetPluginFuncs(NPPluginFuncs* aFuncs);
 
   nsresult NPP_NewInternal(NPMIMEType pluginType, NPP instance,
-                           InfallibleTArray<nsCString>& names,
-                           InfallibleTArray<nsCString>& values,
-                           NPSavedData* saved, NPError* error);
+                           nsTArray<nsCString>& names,
+                           nsTArray<nsCString>& values, NPSavedData* saved,
+                           NPError* error);
 
   // NPP-like API that Gecko calls are trampolined into.  These
   // messages then get forwarded along to the plugin instance,
   // and then eventually the child process.
 
   static NPError NPP_Destroy(NPP instance, NPSavedData** save);
 
   static NPError NPP_SetWindow(NPP instance, NPWindow* window);
@@ -472,17 +472,17 @@ class PluginModuleChromeParent : public 
   enum HangAnnotationFlags {
     kInPluginCall = (1u << 0),
     kHangUIShown = (1u << 1),
     kHangUIContinued = (1u << 2),
     kHangUIDontShow = (1u << 3)
   };
   Atomic<uint32_t> mHangAnnotationFlags;
 #ifdef XP_WIN
-  InfallibleTArray<float> mPluginCpuUsageOnHang;
+  nsTArray<float> mPluginCpuUsageOnHang;
   PluginHangUIParent* mHangUIParent;
   bool mHangUIEnabled;
   bool mIsTimerReset;
 
   /**
    * Launches the Plugin Hang UI.
    *
    * @return true if plugin-hang-ui.exe has been successfully launched.
--- a/dom/plugins/ipc/PluginScriptableObjectChild.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.cpp
@@ -686,18 +686,18 @@ mozilla::ipc::IPCResult PluginScriptable
   }
 
   StackIdentifier id(aId);
   *aHasMethod = mObject->_class->hasMethod(mObject, id.ToNPIdentifier());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectChild::AnswerInvoke(
-    const PluginIdentifier& aId, InfallibleTArray<Variant>&& aArgs,
-    Variant* aResult, bool* aSuccess) {
+    const PluginIdentifier& aId, nsTArray<Variant>&& aArgs, Variant* aResult,
+    bool* aSuccess) {
   AssertPluginThread();
   PluginInstanceChild::AutoStackHelper guard(mInstance);
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerInvoke with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return IPC_OK();
@@ -755,17 +755,17 @@ mozilla::ipc::IPCResult PluginScriptable
   }
 
   *aSuccess = true;
   *aResult = convertedResult;
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectChild::AnswerInvokeDefault(
-    InfallibleTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
+    nsTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
   AssertPluginThread();
   PluginInstanceChild::AutoStackHelper guard(mInstance);
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerInvokeDefault with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return IPC_OK();
@@ -958,17 +958,17 @@ mozilla::ipc::IPCResult PluginScriptable
   *aSuccess = mObject->_class->hasProperty(mObject, id)
                   ? mObject->_class->removeProperty(mObject, id)
                   : true;
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectChild::AnswerEnumerate(
-    InfallibleTArray<PluginIdentifier>* aProperties, bool* aSuccess) {
+    nsTArray<PluginIdentifier>* aProperties, bool* aSuccess) {
   AssertPluginThread();
   PluginInstanceChild::AutoStackHelper guard(mInstance);
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerEnumerate with an invalidated object!");
     *aSuccess = false;
     return IPC_OK();
   }
@@ -995,17 +995,17 @@ mozilla::ipc::IPCResult PluginScriptable
   }
 
   PluginModuleChild::sBrowserFuncs.memfree(ids);
   *aSuccess = true;
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectChild::AnswerConstruct(
-    InfallibleTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
+    nsTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
   AssertPluginThread();
   PluginInstanceChild::AutoStackHelper guard(mInstance);
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerConstruct with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return IPC_OK();
--- a/dom/plugins/ipc/PluginScriptableObjectChild.h
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.h
@@ -45,20 +45,20 @@ class PluginScriptableObjectChild : publ
   void InitializeLocal(NPObject* aObject);
 
   mozilla::ipc::IPCResult AnswerInvalidate();
 
   mozilla::ipc::IPCResult AnswerHasMethod(const PluginIdentifier& aId,
                                           bool* aHasMethod);
 
   mozilla::ipc::IPCResult AnswerInvoke(const PluginIdentifier& aId,
-                                       InfallibleTArray<Variant>&& aArgs,
+                                       nsTArray<Variant>&& aArgs,
                                        Variant* aResult, bool* aSuccess);
 
-  mozilla::ipc::IPCResult AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
+  mozilla::ipc::IPCResult AnswerInvokeDefault(nsTArray<Variant>&& aArgs,
                                               Variant* aResult, bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerHasProperty(const PluginIdentifier& aId,
                                             bool* aHasProperty);
 
   mozilla::ipc::IPCResult AnswerGetChildProperty(const PluginIdentifier& aId,
                                                  bool* aHasProperty,
                                                  bool* aHasMethod,
@@ -68,19 +68,19 @@ class PluginScriptableObjectChild : publ
   mozilla::ipc::IPCResult AnswerSetProperty(const PluginIdentifier& aId,
                                             const Variant& aValue,
                                             bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerRemoveProperty(const PluginIdentifier& aId,
                                                bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerEnumerate(
-      InfallibleTArray<PluginIdentifier>* aProperties, bool* aSuccess);
+      nsTArray<PluginIdentifier>* aProperties, bool* aSuccess);
 
-  mozilla::ipc::IPCResult AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
+  mozilla::ipc::IPCResult AnswerConstruct(nsTArray<Variant>&& aArgs,
                                           Variant* aResult, bool* aSuccess);
 
   mozilla::ipc::IPCResult RecvProtect();
 
   mozilla::ipc::IPCResult RecvUnprotect();
 
   NPObject* GetObject(bool aCanResurrect);
 
--- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp
@@ -723,18 +723,18 @@ mozilla::ipc::IPCResult PluginScriptable
     return IPC_OK();
   }
   *aHasMethod =
       npn->hasmethod(instance->GetNPP(), mObject, stackID.ToNPIdentifier());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectParent::AnswerInvoke(
-    const PluginIdentifier& aId, InfallibleTArray<Variant>&& aArgs,
-    Variant* aResult, bool* aSuccess) {
+    const PluginIdentifier& aId, nsTArray<Variant>&& aArgs, Variant* aResult,
+    bool* aSuccess) {
   if (!mObject) {
     NS_WARNING("Calling AnswerInvoke with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return IPC_OK();
   }
 
   NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
@@ -811,17 +811,17 @@ mozilla::ipc::IPCResult PluginScriptable
   }
 
   *aResult = convertedResult;
   *aSuccess = true;
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectParent::AnswerInvokeDefault(
-    InfallibleTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
+    nsTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
   if (!mObject) {
     NS_WARNING("Calling AnswerInvoke with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return IPC_OK();
   }
 
   NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
@@ -1060,17 +1060,17 @@ mozilla::ipc::IPCResult PluginScriptable
   }
 
   *aSuccess = npn->removeproperty(instance->GetNPP(), mObject,
                                   stackID.ToNPIdentifier());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectParent::AnswerEnumerate(
-    InfallibleTArray<PluginIdentifier>* aProperties, bool* aSuccess) {
+    nsTArray<PluginIdentifier>* aProperties, bool* aSuccess) {
   if (!mObject) {
     NS_WARNING("Calling AnswerEnumerate with an invalidated object!");
     *aSuccess = false;
     return IPC_OK();
   }
 
   NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
   NS_ASSERTION(mType == LocalObject, "Bad type!");
@@ -1107,17 +1107,17 @@ mozilla::ipc::IPCResult PluginScriptable
   }
 
   npn->memfree(ids);
   *aSuccess = true;
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult PluginScriptableObjectParent::AnswerConstruct(
-    InfallibleTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
+    nsTArray<Variant>&& aArgs, Variant* aResult, bool* aSuccess) {
   if (!mObject) {
     NS_WARNING("Calling AnswerConstruct with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return IPC_OK();
   }
 
   NS_ASSERTION(mObject->_class != GetClass(), "Bad object type!");
--- a/dom/plugins/ipc/PluginScriptableObjectParent.h
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.h
@@ -42,20 +42,20 @@ class PluginScriptableObjectParent : pub
   void InitializeLocal(NPObject* aObject);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) override;
 
   mozilla::ipc::IPCResult AnswerHasMethod(const PluginIdentifier& aId,
                                           bool* aHasMethod);
 
   mozilla::ipc::IPCResult AnswerInvoke(const PluginIdentifier& aId,
-                                       InfallibleTArray<Variant>&& aArgs,
+                                       nsTArray<Variant>&& aArgs,
                                        Variant* aResult, bool* aSuccess);
 
-  mozilla::ipc::IPCResult AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
+  mozilla::ipc::IPCResult AnswerInvokeDefault(nsTArray<Variant>&& aArgs,
                                               Variant* aResult, bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerHasProperty(const PluginIdentifier& aId,
                                             bool* aHasProperty);
 
   mozilla::ipc::IPCResult AnswerGetParentProperty(const PluginIdentifier& aId,
                                                   Variant* aResult,
                                                   bool* aSuccess);
@@ -63,19 +63,19 @@ class PluginScriptableObjectParent : pub
   mozilla::ipc::IPCResult AnswerSetProperty(const PluginIdentifier& aId,
                                             const Variant& aValue,
                                             bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerRemoveProperty(const PluginIdentifier& aId,
                                                bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerEnumerate(
-      InfallibleTArray<PluginIdentifier>* aProperties, bool* aSuccess);
+      nsTArray<PluginIdentifier>* aProperties, bool* aSuccess);
 
-  mozilla::ipc::IPCResult AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
+  mozilla::ipc::IPCResult AnswerConstruct(nsTArray<Variant>&& aArgs,
                                           Variant* aResult, bool* aSuccess);
 
   mozilla::ipc::IPCResult AnswerNPN_Evaluate(const nsCString& aScript,
                                              Variant* aResult, bool* aSuccess);
 
   mozilla::ipc::IPCResult RecvProtect();
 
   mozilla::ipc::IPCResult RecvUnprotect();
--- a/dom/plugins/ipc/PluginScriptableObjectUtils.h
+++ b/dom/plugins/ipc/PluginScriptableObjectUtils.h
@@ -175,42 +175,40 @@ class ProtectedVariantArray {
         mOk = false;
         return;
       }
     }
     mOk = true;
   }
 
   ~ProtectedVariantArray() {
-    InfallibleTArray<Variant>& vars = EnsureAndGetShadowArray();
+    nsTArray<Variant>& vars = EnsureAndGetShadowArray();
     uint32_t count = vars.Length();
     for (uint32_t index = 0; index < count; index++) {
       ReleaseRemoteVariant(vars[index]);
     }
   }
 
-  operator const InfallibleTArray<Variant>&() {
-    return EnsureAndGetShadowArray();
-  }
+  operator const nsTArray<Variant>&() { return EnsureAndGetShadowArray(); }
 
   bool IsOk() { return mOk; }
 
  private:
-  InfallibleTArray<Variant>& EnsureAndGetShadowArray() {
+  nsTArray<Variant>& EnsureAndGetShadowArray() {
     if (!mUsingShadowArray) {
       mShadowArray.SwapElements(mArray);
       mUsingShadowArray = true;
     }
     return mShadowArray;
   }
 
   // We convert the variants fallibly, but pass them to Call*()
   // methods as an infallible array
   nsTArray<Variant> mArray;
-  InfallibleTArray<Variant> mShadowArray;
+  nsTArray<Variant> mShadowArray;
   bool mOk;
   bool mUsingShadowArray;
 };
 
 template <class ActorType>
 struct ProtectedActorTraits {
   static bool Nullable();
 };
--- a/dom/storage/StorageDBThread.cpp
+++ b/dom/storage/StorageDBThread.cpp
@@ -308,18 +308,17 @@ void StorageDBThread::AsyncFlush() {
   monitor.Notify();
 }
 
 bool StorageDBThread::ShouldPreloadOrigin(const nsACString& aOrigin) {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
   return mOriginsHavingData.Contains(aOrigin);
 }
 
-void StorageDBThread::GetOriginsHavingData(
-    InfallibleTArray<nsCString>* aOrigins) {
+void StorageDBThread::GetOriginsHavingData(nsTArray<nsCString>* aOrigins) {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
   for (auto iter = mOriginsHavingData.Iter(); !iter.Done(); iter.Next()) {
     aOrigins->AppendElement(iter.Get()->GetKey());
   }
 }
 
 nsresult StorageDBThread::InsertDBOp(StorageDBThread::DBOperation* aOperation) {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
--- a/dom/storage/StorageDBThread.h
+++ b/dom/storage/StorageDBThread.h
@@ -373,17 +373,17 @@ class StorageDBThread final {
                                aPattern));
   }
 
   virtual void AsyncFlush();
 
   virtual bool ShouldPreloadOrigin(const nsACString& aOrigin);
 
   // Get the complete list of scopes having data.
-  void GetOriginsHavingData(InfallibleTArray<nsCString>* aOrigins);
+  void GetOriginsHavingData(nsTArray<nsCString>* aOrigins);
 
  private:
   nsCOMPtr<nsIFile> mDatabaseFile;
   PRThread* mThread;
 
   // Used to observe runnables dispatched to our thread and to monitor it.
   RefPtr<ThreadObserver> mThreadObserver;
 
--- a/dom/storage/StorageIPC.cpp
+++ b/dom/storage/StorageIPC.cpp
@@ -247,17 +247,17 @@ void StorageDBChild::SyncPreload(LocalSt
     aCache->LoadDone(NS_ERROR_UNEXPECTED);
     return;
   }
 
   // There is no way to put the child process to a wait state to receive all
   // incoming async responses from the parent, hence we have to do a sync
   // preload instead.  We are smart though, we only demand keys that are left to
   // load in case the async preload has already loaded some keys.
-  InfallibleTArray<nsString> keys, values;
+  nsTArray<nsString> keys, values;
   nsresult rv;
   SendPreload(aCache->OriginSuffix(), aCache->OriginNoSuffix(),
               aCache->LoadedCount(), &keys, &values, &rv);
 
   for (uint32_t i = 0; i < keys.Length(); ++i) {
     aCache->LoadItem(keys[i], values[i]);
   }
 
@@ -616,17 +616,17 @@ void StorageDBParent::Init() {
 
   if (BackgroundParent::IsOtherProcessActor(actor)) {
     mObserverSink = new ObserverSink(this);
     mObserverSink->Start();
   }
 
   StorageDBThread* storageThread = StorageDBThread::Get();
   if (storageThread) {
-    InfallibleTArray<nsCString> scopes;
+    nsTArray<nsCString> scopes;
     storageThread->GetOriginsHavingData(&scopes);
     mozilla::Unused << SendOriginsHavingData(scopes);
   }
 }
 
 StorageDBParent::CacheParentBridge* StorageDBParent::NewCache(
     const nsACString& aOriginSuffix, const nsACString& aOriginNoSuffix) {
   return new CacheParentBridge(this, aOriginSuffix, aOriginNoSuffix);
@@ -681,19 +681,18 @@ namespace {
 // We need another implementation of LocalStorageCacheBridge to do
 // synchronous IPC preload.  This class just receives Load* notifications
 // and fills the returning arguments of RecvPreload with the database
 // values for us.
 class SyncLoadCacheHelper : public LocalStorageCacheBridge {
  public:
   SyncLoadCacheHelper(const nsCString& aOriginSuffix,
                       const nsCString& aOriginNoSuffix,
-                      uint32_t aAlreadyLoadedCount,
-                      InfallibleTArray<nsString>* aKeys,
-                      InfallibleTArray<nsString>* aValues, nsresult* rv)
+                      uint32_t aAlreadyLoadedCount, nsTArray<nsString>* aKeys,
+                      nsTArray<nsString>* aValues, nsresult* rv)
       : mMonitor("DOM Storage SyncLoad IPC"),
         mSuffix(aOriginSuffix),
         mOrigin(aOriginNoSuffix),
         mKeys(aKeys),
         mValues(aValues),
         mRv(rv),
         mLoaded(false),
         mLoadedCount(aAlreadyLoadedCount) {
@@ -740,29 +739,29 @@ class SyncLoadCacheHelper : public Local
     while (!mLoaded) {
       monitor.Wait();
     }
   }
 
  private:
   Monitor mMonitor;
   nsCString mSuffix, mOrigin;
-  InfallibleTArray<nsString>* mKeys;
-  InfallibleTArray<nsString>* mValues;
+  nsTArray<nsString>* mKeys;
+  nsTArray<nsString>* mValues;
   nsresult* mRv;
   bool mLoaded;
   uint32_t mLoadedCount;
 };
 
 }  // namespace
 
 mozilla::ipc::IPCResult StorageDBParent::RecvPreload(
     const nsCString& aOriginSuffix, const nsCString& aOriginNoSuffix,
-    const uint32_t& aAlreadyLoadedCount, InfallibleTArray<nsString>* aKeys,
-    InfallibleTArray<nsString>* aValues, nsresult* aRv) {
+    const uint32_t& aAlreadyLoadedCount, nsTArray<nsString>* aKeys,
+    nsTArray<nsString>* aValues, nsresult* aRv) {
   StorageDBThread* storageThread = StorageDBThread::GetOrCreate(mProfilePath);
   if (!storageThread) {
     return IPC_FAIL_NO_REASON(this);
   }
 
   RefPtr<SyncLoadCacheHelper> cache(
       new SyncLoadCacheHelper(aOriginSuffix, aOriginNoSuffix,
                               aAlreadyLoadedCount, aKeys, aValues, aRv));
--- a/dom/storage/StorageIPC.h
+++ b/dom/storage/StorageIPC.h
@@ -338,18 +338,18 @@ class StorageDBParent final : public PBa
   mozilla::ipc::IPCResult RecvDeleteMe() override;
 
   mozilla::ipc::IPCResult RecvAsyncPreload(const nsCString& aOriginSuffix,
                                            const nsCString& aOriginNoSuffix,
                                            const bool& aPriority) override;
   mozilla::ipc::IPCResult RecvPreload(const nsCString& aOriginSuffix,
                                       const nsCString& aOriginNoSuffix,
                                       const uint32_t& aAlreadyLoadedCount,
-                                      InfallibleTArray<nsString>* aKeys,
-                                      InfallibleTArray<nsString>* aValues,
+                                      nsTArray<nsString>* aKeys,
+                                      nsTArray<nsString>* aValues,
                                       nsresult* aRv) override;
   mozilla::ipc::IPCResult RecvAsyncGetUsage(
       const nsCString& aOriginNoSuffix) override;
   mozilla::ipc::IPCResult RecvAsyncAddItem(const nsCString& aOriginSuffix,
                                            const nsCString& aOriginNoSuffix,
                                            const nsString& aKey,
                                            const nsString& aValue) override;
   mozilla::ipc::IPCResult RecvAsyncUpdateItem(const nsCString& aOriginSuffix,
--- a/dom/svg/crashtests/crashtests.list
+++ b/dom/svg/crashtests/crashtests.list
@@ -9,17 +9,17 @@ load 369291-1.svg
 load 369291-2.svg
 load 369568-1.svg
 load 374882-1.svg
 load 380101-1.svg 
 load 381777-1.svg
 load 383685-1.svg
 load 385096.html
 load 385554-1.html
-load 385554-2.xul
+load chrome://reftest/content/crashtests/dom/svg/crashtests/385554-2.xul
 load 388712-1.svg
 load 395616-1.html
 load 396618-1.html
 load 397017-1.html
 load 397551-1.svg
 load 397704-1.svg
 load 398926-both-different.svg
 load 398926-both-same.svg
--- a/dom/system/nsDeviceSensors.cpp
+++ b/dom/system/nsDeviceSensors.cpp
@@ -292,17 +292,17 @@ static Orientation RotationVectorToOrien
   }
 
   return Orientation::RadToDeg(orient);
 }
 
 void nsDeviceSensors::Notify(const mozilla::hal::SensorData& aSensorData) {
   uint32_t type = aSensorData.sensor();
 
-  const InfallibleTArray<float>& values = aSensorData.values();
+  const nsTArray<float>& values = aSensorData.values();
   size_t len = values.Length();
   double x = len > 0 ? values[0] : 0.0;
   double y = len > 1 ? values[1] : 0.0;
   double z = len > 2 ? values[2] : 0.0;
   double w = len > 3 ? values[3] : 0.0;
   PRTime timestamp = aSensorData.timestamp();
 
   nsCOMArray<nsIDOMWindow> windowListeners;
--- a/dom/vr/VRServiceTest.h
+++ b/dom/vr/VRServiceTest.h
@@ -190,16 +190,16 @@ class VRServiceTest final : public DOMEv
   // When the command buffer is submitted to the PuppetSession, with
   // VRServiceTest::Run(), it is cleared  to ensure that the commands are not
   // sent redundantly in subsequent VRServicetest::Run() calls.
   // VRServiceTest::Commit() will perform a binary comparison of mPendingState
   // and mEncodedState to determine what instructions need to be appended to
   // mCommandBuffer.
   // VRServiceTest::Reset() will effectively cancel all transactions and clear
   // mCommandBuffer before submitting the reset request to the PuppetSession.
-  InfallibleTArray<uint64_t> mCommandBuffer;
+  nsTArray<uint64_t> mCommandBuffer;
   bool mShuttingDown;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
 #endif  // mozilla_dom_VRServiceTest_h_
--- a/dom/webidl/FrameLoader.webidl
+++ b/dom/webidl/FrameLoader.webidl
@@ -116,40 +116,16 @@ interface FrameLoader {
    * @param aProgressListener optional print progress listener.
    */
   [Throws]
   void print(unsigned long long aOuterWindowID,
              nsIPrintSettings aPrintSettings,
              optional nsIWebProgressListener? aProgressListener = null);
 
   /**
-   * Renders a region of the frame into an image bitmap.
-   *
-   * @param x
-   * @param y
-   * @param w
-   * @param h Specify the area of the window to render, in CSS
-   * pixels. This is relative to the current scroll position.
-   * @param scale The scale to render the window at. Use devicePixelRatio
-   * to have comparable rendering to the OS.
-   * @param backgroundColor The background color to use.
-   *
-   * This API can only be used in the parent process, as content processes
-   * cannot access the rendering of out of process iframes. This API works
-   * with remote and local frames.
-   */
-  [Throws]
-  Promise<ImageBitmap> drawSnapshot(double x,
-                                    double y,
-                                    double w,
-                                    double h,
-                                    double scale,
-                                    DOMString backgroundColor);
-
-  /**
    * The element which owns this frame loader.
    *
    * For example, if this is a frame loader for an <iframe>, this attribute
    * returns the iframe element.
    */
   [Pure]
   readonly attribute Element? ownerElement;
 
--- a/dom/xbl/crashtests/crashtests.list
+++ b/dom/xbl/crashtests/crashtests.list
@@ -1,38 +1,38 @@
 load 205735-1.xhtml
-load 223799-1.xul
+load chrome://reftest/content/crashtests/dom/xbl/crashtests/223799-1.xul
 load 226744-1.xhtml
-load 232095-1.xul
+load chrome://reftest/content/crashtests/dom/xbl/crashtests/232095-1.xul
 load 277523-1.xhtml
 load 277950-1.xhtml
 skip-if(Android) load 336744-1.html # bug 1268050
 load 336960-1.html
 load 342954-1.xhtml
 load 342954-2.xhtml
 load 368276-1.xhtml
 load 368641-1.xhtml
 load 378521-1.xhtml
 load 382376-1.xhtml
 load 382376-2.xhtml
 load 397596-1.xhtml
-load 406900-1.xul
+load chrome://reftest/content/crashtests/dom/xbl/crashtests/406900-1.xul
 load 406904-1.xhtml
 load 406904-2.xhtml
-load 415192-1.xul
+load chrome://reftest/content/crashtests/dom/xbl/crashtests/415192-1.xul
 load 418133-1.xhtml
 load 420233-1.xhtml
 load 421997-1.xhtml
 load 432813-1.xhtml
 load 454820-1.html
 load 460665-1.xhtml
 load 464863-1.xhtml
 load 472260-1.xhtml
 load 477878-1.html
-load 492978-1.xul
+load chrome://reftest/content/crashtests/dom/xbl/crashtests/492978-1.xul
 load 493123-1.xhtml
 load 495354-1.xhtml
 load 507628-1.xhtml
 load 507991-1.xhtml
-load 830614-1.xul
+load chrome://reftest/content/crashtests/dom/xbl/crashtests/830614-1.xul
 load 895805-1.xhtml
 load set-field-bad-this.xhtml
 load 1382357.xhtml
--- a/dom/xml/crashtests/crashtests.list
+++ b/dom/xml/crashtests/crashtests.list
@@ -1,14 +1,14 @@
 load 136896-1.xml
 load 185285-1.xml
 load 382636-1.xml
 load 382636-2.svg
 load 382636-3.xhtml
-load 382636-4.xul # Throws (bug 455856)
-load 420429.xul
+load chrome://reftest/content/crashtests/dom/xml/crashtests/382636-4.xul # Throws (bug 455856)
+load chrome://reftest/content/crashtests/dom/xml/crashtests/420429.xul
 load 431703-1.xhtml
 load 453278.html
 load 803586.xhtml
 load 994740-1.xhtml
 load 1038887.xhtml
 load 1405878.xml
 load 1523655.xml
--- a/dom/xul/crashtests/crashtests.list
+++ b/dom/xul/crashtests/crashtests.list
@@ -1,27 +1,27 @@
 load 107518-1.xml
-load 252448-1.xul
-load 253479-1.xul
-load 253479-2.xul
-load 326204-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/252448-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/253479-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/253479-2.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/326204-1.xul
 load 326644-1.html
-load 326864-1.xul
-load 326875-1.xul
-load 326881-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/326864-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/326875-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/326881-1.xul
 load 329982-1.xhtml
 load 336096-1.xhtml
-load 344215-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/344215-1.xul
 load 354611-1.html
 load 360078-1.xhtml
-load 363791-1.xul
-load 384740-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/363791-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/384740-1.xul
 load 384877-1.html
 load 386914-1.html
-load 386947-1.xul
-load 425821-1.xul
-load 428951-1.xul
+asserts(1) load chrome://reftest/content/crashtests/dom/xul/crashtests/386947-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/425821-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/428951-1.xul
 load 429085-1.xhtml
 load 431906-1.html
 load 461917-1.xhtml
-load 468211-1.xul
-load 468211-2.xul
-load 468211-3.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/468211-1.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/468211-2.xul
+load chrome://reftest/content/crashtests/dom/xul/crashtests/468211-3.xul
--- a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.cpp
+++ b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.cpp
@@ -50,17 +50,17 @@ mozilla::ipc::IPCResult RemoteSpellcheck
     misspells.AppendElement(misspelled);
   }
   aResolve(std::move(misspells));
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult RemoteSpellcheckEngineParent::RecvCheckAndSuggest(
     const nsString& aWord, bool* aIsMisspelled,
-    InfallibleTArray<nsString>* aSuggestions) {
+    nsTArray<nsString>* aSuggestions) {
   nsresult rv = mSpellChecker->CheckWord(aWord, aIsMisspelled, aSuggestions);
   if (NS_FAILED(rv)) {
     aSuggestions->Clear();
     *aIsMisspelled = false;
   }
   return IPC_OK();
 }
 
--- a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.h
+++ b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.h
@@ -26,17 +26,17 @@ class RemoteSpellcheckEngineParent : pub
   virtual mozilla::ipc::IPCResult RecvSetDictionaryFromList(
       nsTArray<nsString>&& aList, SetDictionaryFromListResolver&& aResolve);
 
   virtual mozilla::ipc::IPCResult RecvCheckAsync(nsTArray<nsString>&& aWord,
                                                  CheckAsyncResolver&& aResolve);
 
   virtual mozilla::ipc::IPCResult RecvCheckAndSuggest(
       const nsString& aWord, bool* aIsMisspelled,
-      InfallibleTArray<nsString>* aSuggestions);
+      nsTArray<nsString>* aSuggestions);
 
  private:
   RefPtr<mozSpellChecker> mSpellChecker;
 };
 
 }  // namespace mozilla
 
 #endif
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -1644,17 +1644,17 @@ class GFX2D_API Factory {
   static already_AddRefed<DrawTargetCapture> CreateCaptureDrawTargetForData(
       BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat,
       int32_t aStride, size_t aSurfaceAllocationSize);
 
   static already_AddRefed<DrawTarget> CreateWrapAndRecordDrawTarget(
       DrawEventRecorder* aRecorder, DrawTarget* aDT);
 
   static already_AddRefed<DrawTarget> CreateRecordingDrawTarget(
-      DrawEventRecorder* aRecorder, DrawTarget* aDT, IntSize aSize);
+      DrawEventRecorder* aRecorder, DrawTarget* aDT, IntRect aRect);
 
   static already_AddRefed<DrawTarget> CreateDrawTargetForData(
       BackendType aBackend, unsigned char* aData, const IntSize& aSize,
       int32_t aStride, SurfaceFormat aFormat, bool aUninitialized = false);
 
 #ifdef XP_DARWIN
   static already_AddRefed<ScaledFont> CreateScaledFontForMacFont(
       CGFontRef aCGFont, const RefPtr<UnscaledFont>& aUnscaledFont, Float aSize,
--- a/gfx/2d/DrawEventRecorder.cpp
+++ b/gfx/2d/DrawEventRecorder.cpp
@@ -87,18 +87,18 @@ void DrawEventRecorderFile::Close() {
   mOutputStream.close();
 }
 
 DrawEventRecorderMemory::DrawEventRecorderMemory() {
   WriteHeader(mOutputStream);
 }
 
 DrawEventRecorderMemory::DrawEventRecorderMemory(
-    const SerializeResourcesFn& aFn)
-    : mSerializeCallback(aFn) {
+    const SerializeResourcesFn& aFn, IntPoint aOrigin)
+    : mSerializeCallback(aFn), mOrigin(aOrigin) {
   mExternalFonts = !!mSerializeCallback;
   WriteHeader(mOutputStream);
 }
 
 void DrawEventRecorderMemory::Flush() {}
 
 void DrawEventRecorderMemory::FlushItem(IntRect aRect) {
   MOZ_RELEASE_ASSERT(!aRect.IsEmpty());
@@ -129,16 +129,17 @@ bool DrawEventRecorderMemory::Finish() {
   // for example if there are no items in a particular area
   size_t indexOffset = mOutputStream.mLength;
   // write out the index
   mOutputStream.write(mIndex.mData, mIndex.mLength);
   bool hasItems = mIndex.mLength != 0;
   mIndex = MemStream();
   // write out the offset of the Index to the end of the output stream
   WriteElement(mOutputStream, indexOffset);
+  WriteElement(mOutputStream, mOrigin);
   ClearResources();
   return hasItems;
 }
 
 size_t DrawEventRecorderMemory::RecordingSize() {
   return mOutputStream.mLength;
 }
 
--- a/gfx/2d/DrawEventRecorder.h
+++ b/gfx/2d/DrawEventRecorder.h
@@ -174,17 +174,18 @@ typedef std::function<void(MemStream& aS
 class DrawEventRecorderMemory : public DrawEventRecorderPrivate {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorderMemory, override)
 
   /**
    * Constructs a DrawEventRecorder that stores the recording in memory.
    */
   DrawEventRecorderMemory();
-  explicit DrawEventRecorderMemory(const SerializeResourcesFn& aSerialize);
+  explicit DrawEventRecorderMemory(const SerializeResourcesFn& aSerialize,
+                                   IntPoint aOrigin = IntPoint());
 
   void RecordEvent(const RecordedEvent& aEvent) override;
 
   void AddDependentSurface(uint64_t aDependencyId) override;
 
   nsTHashtable<nsUint64HashKey>&& TakeDependentSurfaces();
 
   /**
@@ -211,16 +212,17 @@ class DrawEventRecorderMemory : public D
   MemStream mIndex;
 
  protected:
   virtual ~DrawEventRecorderMemory(){};
 
  private:
   SerializeResourcesFn mSerializeCallback;
   nsTHashtable<nsUint64HashKey> mDependentSurfaces;
+  IntPoint mOrigin;
 
   void Flush() override;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_DRAWEVENTRECORDER_H_ */
--- a/gfx/2d/DrawTargetRecording.cpp
+++ b/gfx/2d/DrawTargetRecording.cpp
@@ -206,31 +206,31 @@ class FilterNodeRecording : public Filte
   }
 
   FilterBackend GetBackendType() override { return FILTER_BACKEND_RECORDING; }
 
   RefPtr<DrawEventRecorderPrivate> mRecorder;
 };
 
 DrawTargetRecording::DrawTargetRecording(DrawEventRecorder* aRecorder,
-                                         DrawTarget* aDT, IntSize aSize,
+                                         DrawTarget* aDT, IntRect aRect,
                                          bool aHasData)
     : mRecorder(static_cast<DrawEventRecorderPrivate*>(aRecorder)),
       mFinalDT(aDT),
-      mSize(aSize) {
+      mRect(aRect) {
   RefPtr<SourceSurface> snapshot = aHasData ? mFinalDT->Snapshot() : nullptr;
   mRecorder->RecordEvent(
-      RecordedDrawTargetCreation(this, mFinalDT->GetBackendType(), mSize,
+      RecordedDrawTargetCreation(this, mFinalDT->GetBackendType(), mRect,
                                  mFinalDT->GetFormat(), aHasData, snapshot));
   mFormat = mFinalDT->GetFormat();
 }
 
 DrawTargetRecording::DrawTargetRecording(const DrawTargetRecording* aDT,
-                                         IntSize aSize, SurfaceFormat aFormat)
-    : mRecorder(aDT->mRecorder), mFinalDT(aDT->mFinalDT), mSize(aSize) {
+                                         IntRect aRect, SurfaceFormat aFormat)
+    : mRecorder(aDT->mRecorder), mFinalDT(aDT->mFinalDT), mRect(aRect) {
   mFormat = aFormat;
 }
 
 DrawTargetRecording::~DrawTargetRecording() {
   mRecorder->RecordEvent(RecordedDrawTargetDestruction(ReferencePtr(this)));
 }
 
 void DrawTargetRecording::FillRect(const Rect& aRect, const Pattern& aPattern,
@@ -356,27 +356,27 @@ void DrawTargetRecording::Stroke(const P
   EnsurePatternDependenciesStored(aPattern);
 
   mRecorder->RecordEvent(
       RecordedStroke(this, pathRecording, aPattern, aStrokeOptions, aOptions));
 }
 
 already_AddRefed<SourceSurface> DrawTargetRecording::Snapshot() {
   RefPtr<SourceSurface> retSurf =
-      new SourceSurfaceRecording(mSize, mFormat, mRecorder);
+      new SourceSurfaceRecording(mRect.Size(), mFormat, mRecorder);
 
   mRecorder->RecordEvent(RecordedSnapshot(retSurf, this));
 
   return retSurf.forget();
 }
 
 already_AddRefed<SourceSurface> DrawTargetRecording::IntoLuminanceSource(
     LuminanceType aLuminanceType, float aOpacity) {
   RefPtr<SourceSurface> retSurf =
-      new SourceSurfaceRecording(mSize, SurfaceFormat::A8, mRecorder);
+      new SourceSurfaceRecording(mRect.Size(), SurfaceFormat::A8, mRecorder);
 
   mRecorder->RecordEvent(
       RecordedIntoLuminanceSource(retSurf, this, aLuminanceType, aOpacity));
 
   return retSurf.forget();
 }
 
 void DrawTargetRecording::Flush() {
@@ -514,17 +514,18 @@ DrawTargetRecording::CreateSourceSurface
   MOZ_ASSERT(false);
   return nullptr;
 }
 
 already_AddRefed<DrawTarget> DrawTargetRecording::CreateSimilarDrawTarget(
     const IntSize& aSize, SurfaceFormat aFormat) const {
   RefPtr<DrawTarget> similarDT;
   if (mFinalDT->CanCreateSimilarDrawTarget(aSize, aFormat)) {
-    similarDT = new DrawTargetRecording(this, aSize, aFormat);
+    similarDT =
+        new DrawTargetRecording(this, IntRect(IntPoint(0, 0), aSize), aFormat);
     mRecorder->RecordEvent(
         RecordedCreateSimilarDrawTarget(similarDT.get(), aSize, aFormat));
   } else if (XRE_IsContentProcess()) {
     // Crash any content process that calls this function with arguments that
     // would fail to create a similar draw target. We do this to root out bad
     // callers. We don't want to crash any important processes though so for
     // for those we'll just gracefully return nullptr.
     MOZ_CRASH(
@@ -537,30 +538,31 @@ already_AddRefed<DrawTarget> DrawTargetR
 bool DrawTargetRecording::CanCreateSimilarDrawTarget(
     const IntSize& aSize, SurfaceFormat aFormat) const {
   return mFinalDT->CanCreateSimilarDrawTarget(aSize, aFormat);
 }
 
 RefPtr<DrawTarget> DrawTargetRecording::CreateClippedDrawTarget(
     const Rect& aBounds, SurfaceFormat aFormat) {
   RefPtr<DrawTarget> similarDT;
-  similarDT = new DrawTargetRecording(this, mSize, aFormat);
+  similarDT = new DrawTargetRecording(this, mRect, aFormat);
   mRecorder->RecordEvent(
       RecordedCreateClippedDrawTarget(similarDT.get(), aBounds, aFormat));
   similarDT->SetTransform(mTransform);
   return similarDT;
 }
 
 already_AddRefed<DrawTarget>
 DrawTargetRecording::CreateSimilarDrawTargetForFilter(
     const IntSize& aMaxSize, SurfaceFormat aFormat, FilterNode* aFilter,
     FilterNode* aSource, const Rect& aSourceRect, const Point& aDestPoint) {
   RefPtr<DrawTarget> similarDT;
   if (mFinalDT->CanCreateSimilarDrawTarget(aMaxSize, aFormat)) {
-    similarDT = new DrawTargetRecording(this, aMaxSize, aFormat);
+    similarDT = new DrawTargetRecording(this, IntRect(IntPoint(0, 0), aMaxSize),
+                                        aFormat);
     mRecorder->RecordEvent(RecordedCreateDrawTargetForFilter(
         this, similarDT.get(), aMaxSize, aFormat, aFilter, aSource, aSourceRect,
         aDestPoint));
   } else if (XRE_IsContentProcess()) {
     // See CreateSimilarDrawTarget
     MOZ_CRASH(
         "Content-process DrawTargetRecording can't create requested clipped "
         "drawtarget");
@@ -618,17 +620,17 @@ already_AddRefed<PathRecording> DrawTarg
 // This should only be called on the 'root' DrawTargetRecording.
 // Calling it on a child DrawTargetRecordings will cause confusion.
 void DrawTargetRecording::FlushItem(const IntRect& aBounds) {
   mRecorder->FlushItem(aBounds);
   // Reinitialize the recorder (FlushItem will write a new recording header)
   // Tell the new recording about our draw target
   // This code should match what happens in the DrawTargetRecording constructor.
   mRecorder->RecordEvent(
-      RecordedDrawTargetCreation(this, mFinalDT->GetBackendType(), mSize,
+      RecordedDrawTargetCreation(this, mFinalDT->GetBackendType(), mRect,
                                  mFinalDT->GetFormat(), false, nullptr));
   // Add the current transform to the new recording
   mRecorder->RecordEvent(
       RecordedSetTransform(this, DrawTarget::GetTransform()));
 }
 
 void DrawTargetRecording::EnsurePatternDependenciesStored(
     const Pattern& aPattern) {
--- a/gfx/2d/DrawTargetRecording.h
+++ b/gfx/2d/DrawTargetRecording.h
@@ -12,17 +12,17 @@
 
 namespace mozilla {
 namespace gfx {
 
 class DrawTargetRecording : public DrawTarget {
  public:
   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTargetRecording, override)
   DrawTargetRecording(DrawEventRecorder* aRecorder, DrawTarget* aDT,
-                      IntSize aSize, bool aHasData = false);
+                      IntRect aRect, bool aHasData = false);
 
   ~DrawTargetRecording();
 
   virtual DrawTargetType GetType() const override {
     return mFinalDT->GetType();
   }
   virtual BackendType GetBackendType() const override {
     return BackendType::RECORDING;
@@ -30,17 +30,18 @@ class DrawTargetRecording : public DrawT
   virtual bool IsRecording() const override { return true; }
 
   virtual already_AddRefed<SourceSurface> Snapshot() override;
   virtual already_AddRefed<SourceSurface> IntoLuminanceSource(
       LuminanceType aLuminanceType, float aOpacity) override;
 
   virtual void DetachAllSnapshots() override;
 
-  virtual IntSize GetSize() const override { return mSize; }
+  virtual IntSize GetSize() const override { return mRect.Size(); }
+  virtual IntRect GetRect() const override { return mRect; }
 
   virtual void Flush() override;
 
   virtual void FlushItem(const IntRect& aBounds) override;
 
   /*
    * Draw a surface to the draw target. Possibly doing partial drawing or
    * applying scaling. No sampling happens outside the source.
@@ -349,24 +350,24 @@ class DrawTargetRecording : public DrawT
  private:
   /**
    * Used for creating a DrawTargetRecording for a CreateSimilarDrawTarget call.
    *
    * @param aDT DrawTargetRecording on which CreateSimilarDrawTarget was called
    * @param aSize size of the the similar DrawTarget
    * @param aFormat format of the similar DrawTarget
    */
-  DrawTargetRecording(const DrawTargetRecording* aDT, IntSize aSize,
+  DrawTargetRecording(const DrawTargetRecording* aDT, IntRect aRect,
                       SurfaceFormat aFormat);
 
   Path* GetPathForPathRecording(const Path* aPath) const;
   already_AddRefed<PathRecording> EnsurePathStored(const Path* aPath);
   void EnsurePatternDependenciesStored(const Pattern& aPattern);
 
   RefPtr<DrawEventRecorderPrivate> mRecorder;
   RefPtr<DrawTarget> mFinalDT;
-  IntSize mSize;
+  IntRect mRect;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_DRAWTARGETRECORDING_H_ */
--- a/gfx/2d/DrawTargetWrapAndRecord.cpp
+++ b/gfx/2d/DrawTargetWrapAndRecord.cpp
@@ -277,17 +277,17 @@ struct AdjustedPattern final {
 };
 
 DrawTargetWrapAndRecord::DrawTargetWrapAndRecord(DrawEventRecorder* aRecorder,
                                                  DrawTarget* aDT, bool aHasData)
     : mRecorder(static_cast<DrawEventRecorderPrivate*>(aRecorder)),
       mFinalDT(aDT) {
   RefPtr<SourceSurface> snapshot = aHasData ? mFinalDT->Snapshot() : nullptr;
   mRecorder->RecordEvent(RecordedDrawTargetCreation(
-      this, mFinalDT->GetBackendType(), mFinalDT->GetSize(),
+      this, mFinalDT->GetBackendType(), mFinalDT->GetRect(),
       mFinalDT->GetFormat(), aHasData, snapshot));
   mFormat = mFinalDT->GetFormat();
 }
 
 DrawTargetWrapAndRecord::DrawTargetWrapAndRecord(
     const DrawTargetWrapAndRecord* aDT, DrawTarget* aSimilarDT)
     : mRecorder(aDT->mRecorder), mFinalDT(aSimilarDT) {
   mRecorder->RecordEvent(RecordedCreateSimilarDrawTarget(
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -406,18 +406,18 @@ already_AddRefed<DrawTarget> Factory::Cr
 }
 
 already_AddRefed<DrawTarget> Factory::CreateWrapAndRecordDrawTarget(
     DrawEventRecorder* aRecorder, DrawTarget* aDT) {
   return MakeAndAddRef<DrawTargetWrapAndRecord>(aRecorder, aDT);
 }
 
 already_AddRefed<DrawTarget> Factory::CreateRecordingDrawTarget(
-    DrawEventRecorder* aRecorder, DrawTarget* aDT, IntSize aSize) {
-  return MakeAndAddRef<DrawTargetRecording>(aRecorder, aDT, aSize);
+    DrawEventRecorder* aRecorder, DrawTarget* aDT, IntRect aRect) {
+  return MakeAndAddRef<DrawTargetRecording>(aRecorder, aDT, aRect);
 }
 
 already_AddRefed<DrawTargetCapture> Factory::CreateCaptureDrawTargetForTarget(
     gfx::DrawTarget* aTarget, size_t aFlushBytes) {
   return MakeAndAddRef<DrawTargetCaptureImpl>(aTarget, aFlushBytes);
 }
 
 already_AddRefed<DrawTargetCapture> Factory::CreateCaptureDrawTarget(
--- a/gfx/2d/RecordedEventImpl.h
+++ b/gfx/2d/RecordedEventImpl.h
@@ -36,39 +36,39 @@ class RecordedDrawingEvent : public Reco
 
   ReferencePtr mDT;
 };
 
 class RecordedDrawTargetCreation
     : public RecordedEventDerived<RecordedDrawTargetCreation> {
  public:
   RecordedDrawTargetCreation(ReferencePtr aRefPtr, BackendType aType,
-                             const IntSize& aSize, SurfaceFormat aFormat,
+                             const IntRect& aRect, SurfaceFormat aFormat,
                              bool aHasExistingData = false,
                              SourceSurface* aExistingData = nullptr)
       : RecordedEventDerived(DRAWTARGETCREATION),
         mRefPtr(aRefPtr),
         mBackendType(aType),
-        mSize(aSize),
+        mRect(aRect),
         mFormat(aFormat),
         mHasExistingData(aHasExistingData),
         mExistingData(aExistingData) {}
 
   bool PlayEvent(Translator* aTranslator) const override;
 
   template <class S>
   void Record(S& aStream) const;
   virtual void OutputSimpleEventInfo(
       std::stringstream& aStringStream) const override;
 
   std::string GetName() const override { return "DrawTarget Creation"; }
 
   ReferencePtr mRefPtr;
   BackendType mBackendType;
-  IntSize mSize;
+  IntRect mRect;
   SurfaceFormat mFormat;
   bool mHasExistingData;
   RefPtr<SourceSurface> mExistingData;
 
  private:
   friend class RecordedEvent;
 
   template <class S>
@@ -1726,17 +1726,17 @@ template <class T>
 template <class S>
 void RecordedDrawingEvent<T>::Record(S& aStream) const {
   WriteElement(aStream, mDT);
 }
 
 inline bool RecordedDrawTargetCreation::PlayEvent(
     Translator* aTranslator) const {
   RefPtr<DrawTarget> newDT =
-      aTranslator->CreateDrawTarget(mRefPtr, mSize, mFormat);
+      aTranslator->CreateDrawTarget(mRefPtr, mRect.Size(), mFormat);
 
   // If we couldn't create a DrawTarget this will probably cause us to crash
   // with nullptr later in the playback, so return false to abort.
   if (!newDT) {
     return false;
   }
 
   if (mHasExistingData) {
@@ -1747,66 +1747,66 @@ inline bool RecordedDrawTargetCreation::
 
   return true;
 }
 
 template <class S>
 void RecordedDrawTargetCreation::Record(S& aStream) const {
   WriteElement(aStream, mRefPtr);
   WriteElement(aStream, mBackendType);
-  WriteElement(aStream, mSize);
+  WriteElement(aStream, mRect);
   WriteElement(aStream, mFormat);
   WriteElement(aStream, mHasExistingData);
 
   if (mHasExistingData) {
     MOZ_ASSERT(mExistingData);
-    MOZ_ASSERT(mExistingData->GetSize() == mSize);
+    MOZ_ASSERT(mExistingData->GetSize() == mRect.Size());
     RefPtr<DataSourceSurface> dataSurf = mExistingData->GetDataSurface();
 
     DataSourceSurface::ScopedMap map(dataSurf, DataSourceSurface::READ);
-    for (int y = 0; y < mSize.height; y++) {
+    for (int y = 0; y < mRect.height; y++) {
       aStream.write((const char*)map.GetData() + y * map.GetStride(),
-                    BytesPerPixel(mFormat) * mSize.width);
+                    BytesPerPixel(mFormat) * mRect.width);
     }
   }
 }
 
 template <class S>
 RecordedDrawTargetCreation::RecordedDrawTargetCreation(S& aStream)
     : RecordedEventDerived(DRAWTARGETCREATION), mExistingData(nullptr) {
   ReadElement(aStream, mRefPtr);
   ReadElement(aStream, mBackendType);
-  ReadElement(aStream, mSize);
+  ReadElement(aStream, mRect);
   ReadElement(aStream, mFormat);
   ReadElement(aStream, mHasExistingData);
 
   if (mHasExistingData) {
     RefPtr<DataSourceSurface> dataSurf =
-        Factory::CreateDataSourceSurface(mSize, mFormat);
+        Factory::CreateDataSourceSurface(mRect.Size(), mFormat);
     if (!dataSurf) {
       gfxWarning()
           << "RecordedDrawTargetCreation had to reset mHasExistingData";
       mHasExistingData = false;
       return;
     }
 
     DataSourceSurface::ScopedMap map(dataSurf, DataSourceSurface::READ);
-    for (int y = 0; y < mSize.height; y++) {
+    for (int y = 0; y < mRect.height; y++) {
       aStream.read((char*)map.GetData() + y * map.GetStride(),
-                   BytesPerPixel(mFormat) * mSize.width);
+                   BytesPerPixel(mFormat) * mRect.width);
     }
     mExistingData = dataSurf;
   }
 }
 
 inline void RecordedDrawTargetCreation::OutputSimpleEventInfo(
     std::stringstream& aStringStream) const {
   aStringStream << "[" << mRefPtr << "] DrawTarget Creation (Type: "
-                << NameFromBackend(mBackendType) << ", Size: " << mSize.width
-                << "x" << mSize.height << ")";
+                << NameFromBackend(mBackendType) << ", Size: " << mRect.width
+                << "x" << mRect.height << ")";
 }
 
 inline bool RecordedDrawTargetDestruction::PlayEvent(
     Translator* aTranslator) const {
   aTranslator->RemoveDrawTarget(mRefPtr);
   return true;
 }
 
--- a/gfx/config/gfxVars.cpp
+++ b/gfx/config/gfxVars.cpp
@@ -49,17 +49,17 @@ void gfxVars::Initialize() {
 
   // Note the GPU process is not handled here - it cannot send sync
   // messages, so instead the initial data is pushed down.
   if (XRE_IsContentProcess()) {
     MOZ_ASSERT(gGfxVarInitUpdates,
                "Initial updates should be provided in content process");
     if (!gGfxVarInitUpdates) {
       // No provided initial updates, sync-request them from parent.
-      InfallibleTArray<GfxVarUpdate> initUpdates;
+      nsTArray<GfxVarUpdate> initUpdates;
       dom::ContentChild::GetSingleton()->SendGetGfxVars(&initUpdates);
       gGfxVarInitUpdates = new nsTArray<GfxVarUpdate>(std::move(initUpdates));
     }
     for (const auto& varUpdate : *gGfxVarInitUpdates) {
       ApplyUpdate(varUpdate);
     }
     gGfxVarInitUpdates = nullptr;
   }
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.cpp
@@ -5,19 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DecomposeIntoNoRepeatTriangles.h"
 #include "gfxMatrix.h"
 
 namespace mozilla {
 namespace gl {
 
-void RectTriangles::AppendRectToCoordArray(InfallibleTArray<coord>& array,
-                                           GLfloat x0, GLfloat y0, GLfloat x1,
-                                           GLfloat y1) {
+void RectTriangles::AppendRectToCoordArray(nsTArray<coord>& array, GLfloat x0,
+                                           GLfloat y0, GLfloat x1, GLfloat y1) {
   coord* v = array.AppendElements(6);
 
   v[0].x = x0;
   v[0].y = y0;
   v[1].x = x1;
   v[1].y = y0;
   v[2].x = x0;
   v[2].y = y1;
--- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h
+++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h
@@ -28,28 +28,28 @@ class RectTriangles {
   void addRect(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat tx0,
                GLfloat ty0, GLfloat tx1, GLfloat ty1, bool flip_y = false);
 
   /**
    * these return a float pointer to the start of each array respectively.
    * Use it for glVertexAttribPointer calls.
    * We can return nullptr if we choose to use Vertex Buffer Objects here.
    */
-  InfallibleTArray<coord>& vertCoords() { return mVertexCoords; }
+  nsTArray<coord>& vertCoords() { return mVertexCoords; }
 
-  InfallibleTArray<coord>& texCoords() { return mTexCoords; }
+  nsTArray<coord>& texCoords() { return mTexCoords; }
 
   unsigned int elements() { return mVertexCoords.Length(); }
 
  private:
   // Reserve inline storage for one quad (2 triangles, 3 coords).
   AutoTArray<coord, 6> mVertexCoords;
   AutoTArray<coord, 6> mTexCoords;
 
-  static void AppendRectToCoordArray(InfallibleTArray<coord>& array, GLfloat x0,
+  static void AppendRectToCoordArray(nsTArray<coord>& array, GLfloat x0,
                                      GLfloat y0, GLfloat x1, GLfloat y1);
 };
 
 /**
  * Decompose drawing the possibly-wrapped aTexCoordRect rectangle
  * of a texture of aTexSize into one or more rectangles (represented
  * as 2 triangles) and associated tex coordinates, such that
  * we don't have to use the REPEAT wrap mode. If aFlipY is true, the
--- a/gfx/ipc/CrossProcessPaint.cpp
+++ b/gfx/ipc/CrossProcessPaint.cpp
@@ -4,16 +4,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CrossProcessPaint.h"
 
 #include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/ImageBitmap.h"
 #include "mozilla/dom/BrowserParent.h"
+#include "mozilla/dom/PWindowGlobalParent.h"
+#include "mozilla/dom/WindowGlobalParent.h"
+#include "mozilla/dom/WindowGlobalChild.h"
 #include "mozilla/gfx/DrawEventRecorder.h"
 #include "mozilla/gfx/InlineTranslator.h"
 #include "mozilla/PresShell.h"
 
 #include "gfxPlatform.h"
 
 #include "nsContentUtils.h"
 #include "nsGlobalWindowInner.h"
@@ -36,70 +39,92 @@ namespace gfx {
 
 using namespace mozilla::ipc;
 
 /// The minimum scale we allow tabs to be rasterized at.
 static const float kMinPaintScale = 0.05f;
 
 /* static */
 PaintFragment PaintFragment::Record(nsIDocShell* aDocShell,
-                                    const IntRect& aRect, float aScale,
+                                    const Maybe<IntRect>& aRect, float aScale,
                                     nscolor aBackgroundColor) {
-  IntSize surfaceSize = aRect.Size();
+  if (!aDocShell) {
+    PF_LOG("Couldn't find DocShell.\n");
+    return PaintFragment{};
+  }
+
+  RefPtr<nsPresContext> presContext = aDocShell->GetPresContext();
+  if (!presContext) {
+    PF_LOG("Couldn't find PresContext.\n");
+    return PaintFragment{};
+  }
+
+  IntRect rect;
+  if (!aRect) {
+    nsCOMPtr<nsIWidget> widget =
+        nsContentUtils::WidgetForDocument(aDocShell->GetDocument());
+
+    // TODO: Apply some sort of clipping to visible bounds here (Bug 1562720)
+    LayoutDeviceIntRect boundsDevice = widget->GetBounds();
+    boundsDevice.MoveTo(0, 0);
+    nsRect boundsAu = LayoutDevicePixel::ToAppUnits(
+        boundsDevice, presContext->AppUnitsPerDevPixel());
+    rect = gfx::RoundedOut(CSSPixel::FromAppUnits(boundsAu).ToUnknownRect());
+  } else {
+    rect = *aRect;
+  }
+
+  if (rect.IsEmpty()) {
+    // TODO: Should we return an empty surface here?
+    PF_LOG("Empty rect to paint.\n");
+    return PaintFragment{};
+  }
+
+  IntSize surfaceSize = rect.Size();
   surfaceSize.width *= aScale;
   surfaceSize.height *= aScale;
 
   CPP_LOG(
       "Recording "
       "[docshell=%p, "
       "rect=(%d, %d) x (%d, %d), "
       "scale=%f, "
       "color=(%u, %u, %u, %u)]\n",
-      aDocShell, aRect.x, aRect.y, aRect.width, aRect.height, aScale,
+      aDocShell, rect.x, rect.y, rect.width, rect.height, aScale,
       NS_GET_R(aBackgroundColor), NS_GET_G(aBackgroundColor),
       NS_GET_B(aBackgroundColor), NS_GET_A(aBackgroundColor));
 
   // Check for invalid sizes
   if (surfaceSize.width <= 0 || surfaceSize.height <= 0 ||
       !Factory::CheckSurfaceSize(surfaceSize)) {
     PF_LOG("Invalid surface size of (%d x %d).\n", surfaceSize.width,
            surfaceSize.height);
     return PaintFragment{};
   }
 
   // Flush any pending notifications
   nsContentUtils::FlushLayoutForTree(aDocShell->GetWindow());
 
-  // Grab the presentation shell to render
-  RefPtr<nsPresContext> presContext;
-  if (aDocShell) {
-    presContext = aDocShell->GetPresContext();
-  }
-  if (!presContext) {
-    PF_LOG("Couldn't find PresContext.\n");
-    return PaintFragment{};
-  }
-
   // Initialize the recorder
   SurfaceFormat format = SurfaceFormat::B8G8R8A8;
   RefPtr<DrawTarget> referenceDt = Factory::CreateDrawTarget(
       gfxPlatform::GetPlatform()->GetSoftwareBackend(), IntSize(1, 1), format);
 
   // TODO: This may OOM crash if the content is complex enough
   RefPtr<DrawEventRecorderMemory> recorder =
       MakeAndAddRef<DrawEventRecorderMemory>(nullptr);
-  RefPtr<DrawTarget> dt =
-      Factory::CreateRecordingDrawTarget(recorder, referenceDt, surfaceSize);
+  RefPtr<DrawTarget> dt = Factory::CreateRecordingDrawTarget(
+      recorder, referenceDt, IntRect(IntPoint(0, 0), surfaceSize));
 
   // Perform the actual rendering
   {
-    nsRect r(nsPresContext::CSSPixelsToAppUnits(aRect.x),
-             nsPresContext::CSSPixelsToAppUnits(aRect.y),
-             nsPresContext::CSSPixelsToAppUnits(aRect.width),
-             nsPresContext::CSSPixelsToAppUnits(aRect.height));
+    nsRect r(nsPresContext::CSSPixelsToAppUnits(rect.x),
+             nsPresContext::CSSPixelsToAppUnits(rect.y),
+             nsPresContext::CSSPixelsToAppUnits(rect.width),
+             nsPresContext::CSSPixelsToAppUnits(rect.height));
 
     RefPtr<gfxContext> thebes = gfxContext::CreateOrNull(dt);
     thebes->SetMatrix(Matrix::Scaling(aScale, aScale));
     RefPtr<PresShell> presShell = presContext->PresShell();
     Unused << presShell->RenderDocument(r, RenderDocumentFlags::None,
                                         aBackgroundColor, thebes);
   }
 
@@ -123,247 +148,265 @@ bool PaintFragment::IsEmpty() const {
 
 PaintFragment::PaintFragment(IntSize aSize, ByteBuf&& aRecording,
                              nsTHashtable<nsUint64HashKey>&& aDependencies)
     : mSize(aSize),
       mRecording(std::move(aRecording)),
       mDependencies(std::move(aDependencies)) {}
 
 /* static */
-void CrossProcessPaint::StartLocal(nsIDocShell* aRoot, const IntRect& aRect,
-                                   float aScale, nscolor aBackgroundColor,
-                                   dom::Promise* aPromise) {
-  MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
-  aScale = std::max(aScale, kMinPaintScale);
-
-  CPP_LOG(
-      "Starting local paint. "
-      "[docshell=%p, "
-      "rect=(%d, %d) x (%d, %d), "
-      "scale=%f, "
-      "color=(%u, %u, %u, %u)]\n",
-      aRoot, aRect.x, aRect.y, aRect.width, aRect.height, aScale,
-      NS_GET_R(aBackgroundColor), NS_GET_G(aBackgroundColor),
-      NS_GET_B(aBackgroundColor), NS_GET_A(aBackgroundColor));
-
-  RefPtr<CrossProcessPaint> resolver =
-      new CrossProcessPaint(aPromise, aScale, aBackgroundColor, dom::TabId(0));
-  resolver->ReceiveFragment(
-      dom::TabId(0),
-      PaintFragment::Record(aRoot, aRect, aScale, aBackgroundColor));
-}
-
-/* static */
-void CrossProcessPaint::StartRemote(dom::TabId aRoot, const IntRect& aRect,
-                                    float aScale, nscolor aBackgroundColor,
-                                    dom::Promise* aPromise) {
+bool CrossProcessPaint::Start(dom::WindowGlobalParent* aRoot,
+                              const dom::DOMRect* aRect, float aScale,
+                              nscolor aBackgroundColor,
+                              dom::Promise* aPromise) {
   MOZ_RELEASE_ASSERT(XRE_IsParentProcess());
   aScale = std::max(aScale, kMinPaintScale);
 
   CPP_LOG(
-      "Starting remote paint. "
-      "[tab=%llu, "
-      "rect=(%d, %d) x (%d, %d), "
+      "Starting paint. "
+      "[wgp=%p, "
       "scale=%f, "
       "color=(%u, %u, %u, %u)]\n",
-      (uint64_t)aRoot, aRect.x, aRect.y, aRect.width, aRect.height, aScale,
-      NS_GET_R(aBackgroundColor), NS_GET_G(aBackgroundColor),
+      aRoot, aScale, NS_GET_R(aBackgroundColor), NS_GET_G(aBackgroundColor),
       NS_GET_B(aBackgroundColor), NS_GET_A(aBackgroundColor));
 
+  Maybe<IntRect> rect;
+  if (aRect) {
+    *rect = IntRect::RoundOut((float)aRect->X(), (float)aRect->Y(),
+                              (float)aRect->Width(), (float)aRect->Height());
+  }
+
   RefPtr<CrossProcessPaint> resolver =
       new CrossProcessPaint(aPromise, aScale, aBackgroundColor, aRoot);
-  resolver->QueueRootPaint(aRoot, aRect, aScale, aBackgroundColor);
+
+  if (aRoot->IsInProcess()) {
+    RefPtr<dom::WindowGlobalChild> childActor = aRoot->GetChildActor();
+    if (!childActor) {
+      return false;
+    }
+
+    // `BrowsingContext()` cannot be nullptr.
+    nsCOMPtr<nsIDocShell> docShell =
+        childActor->BrowsingContext()->GetDocShell();
+    if (!docShell) {
+      return false;
+    }
+
+    resolver->mPendingFragments += 1;
+    resolver->ReceiveFragment(
+        aRoot, PaintFragment::Record(docShell, rect, aScale, aBackgroundColor));
+  } else {
+    resolver->QueuePaint(aRoot, rect);
+  }
+  return true;
 }
 
 CrossProcessPaint::CrossProcessPaint(dom::Promise* aPromise, float aScale,
                                      nscolor aBackgroundColor,
-                                     dom::TabId aRootId)
+                                     dom::WindowGlobalParent* aRoot)
     : mPromise{aPromise},
-      mRootId{aRootId},
+      mRoot{aRoot},
       mScale{aScale},
       mBackgroundColor{aBackgroundColor},
-      mPendingFragments{1} {}
+      mPendingFragments{0} {}
 
 CrossProcessPaint::~CrossProcessPaint() {}
 
-void CrossProcessPaint::ReceiveFragment(dom::TabId aId,
+void CrossProcessPaint::ReceiveFragment(dom::WindowGlobalParent* aWGP,
                                         PaintFragment&& aFragment) {
   if (IsCleared()) {
-    CPP_LOG("Ignoring fragment from %llu.\n", (uint64_t)aId);
+    CPP_LOG("Ignoring fragment from %p.\n", aWGP);
     return;
   }
 
   MOZ_ASSERT(mPendingFragments > 0);
-  MOZ_ASSERT(!mReceivedFragments.GetValue(aId));
+  MOZ_ASSERT(!mReceivedFragments.GetValue(aWGP));
   MOZ_ASSERT(!aFragment.IsEmpty());
 
   // Double check our invariants to protect against a compromised content
   // process
-  if (mPendingFragments == 0 || mReceivedFragments.GetValue(aId) ||
+  if (mPendingFragments == 0 || mReceivedFragments.GetValue(aWGP) ||
       aFragment.IsEmpty()) {
-    CPP_LOG("Dropping invalid fragment from %llu.\n", (uint64_t)aId);
-    LostFragment(aId);
+    CPP_LOG("Dropping invalid fragment from %p.\n", aWGP);
+    LostFragment(aWGP);
     return;
   }
 
-  CPP_LOG("Receiving fragment from %llu.\n", (uint64_t)aId);
+  CPP_LOG("Receiving fragment from %p.\n", aWGP);
 
   // Queue paints for child tabs
   for (auto iter = aFragment.mDependencies.Iter(); !iter.Done(); iter.Next()) {
-    auto dependency = iter.Get()->GetKey();
-    QueueSubPaint(dom::TabId(dependency));
+    auto dependency = dom::TabId(iter.Get()->GetKey());
+
+    // Get the current WindowGlobalParent of the remote browser that was marked
+    // as a dependency
+    dom::ContentProcessManager* cpm =
+        dom::ContentProcessManager::GetSingleton();
+    dom::ContentParentId cpId = cpm->GetTabProcessId(dependency);
+    RefPtr<dom::BrowserParent> browser =
+        cpm->GetBrowserParentByProcessAndTabId(cpId, dependency);
+    RefPtr<dom::WindowGlobalParent> wgp =
+        browser->GetBrowsingContext()->GetCurrentWindowGlobal();
+
+    if (!wgp) {
+      CPP_LOG("Skipping dependency %llu with no current WGP.\n",
+              (uint64_t)dependency);
+      continue;
+    }
+
+    // TODO: Apply some sort of clipping to visible bounds here (Bug 1562720)
+    QueuePaint(wgp, Nothing());
   }
 
-  mReceivedFragments.Put(aId, std::move(aFragment));
+  mReceivedFragments.Put(aWGP, std::move(aFragment));
   mPendingFragments -= 1;
 
   // Resolve this paint if we have received all pending fragments
   MaybeResolve();
 }
 
-void CrossProcessPaint::LostFragment(dom::TabId aId) {
+void CrossProcessPaint::LostFragment(dom::WindowGlobalParent* aWGP) {
   if (IsCleared()) {
-    CPP_LOG("Ignoring lost fragment from %llu.\n", (uint64_t)aId);
+    CPP_LOG("Ignoring lost fragment from %p.\n", aWGP);
     return;
   }
 
   mPromise->MaybeReject(NS_ERROR_FAILURE);
   Clear();
 }
 
-void CrossProcessPaint::QueueRootPaint(dom::TabId aId, const IntRect& aRect,
-                                       float aScale, nscolor aBackgroundColor) {
-  MOZ_ASSERT(!mReceivedFragments.GetValue(aId));
-  MOZ_ASSERT(mPendingFragments == 1);
-
-  CPP_LOG("Queueing root paint for %llu.\n", (uint64_t)aId);
-
-  dom::ContentProcessManager* cpm = dom::ContentProcessManager::GetSingleton();
-
-  dom::ContentParentId cpId = cpm->GetTabProcessId(aId);
-  RefPtr<dom::BrowserParent> tab =
-      cpm->GetBrowserParentByProcessAndTabId(cpId, aId);
-  tab->RequestRootPaint(this, aRect, aScale, aBackgroundColor);
+void CrossProcessPaint::QueuePaint(dom::WindowGlobalParent* aWGP,
+                                   const Maybe<IntRect>& aRect) {
+  MOZ_ASSERT(!mReceivedFragments.GetValue(aWGP));
 
-  // This will always be the first paint, so the constructor will already have
-  // incremented one pending fragment
-}
-
-void CrossProcessPaint::QueueSubPaint(dom::TabId aId) {
-  MOZ_ASSERT(!mReceivedFragments.GetValue((uint64_t)aId));
+  CPP_LOG("Queueing paint for %p.\n", aWGP);
 
-  CPP_LOG("Queueing sub paint for %llu.\n", (uint64_t)aId);
-
-  dom::ContentProcessManager* cpm = dom::ContentProcessManager::GetSingleton();
-
-  dom::ContentParentId cpId = cpm->GetTabProcessId(aId);
-  RefPtr<dom::BrowserParent> tab =
-      cpm->GetBrowserParentByProcessAndTabId(cpId, aId);
-  tab->RequestSubPaint(this, mScale, mBackgroundColor);
-
+  // TODO - Don't apply the background color to all paints (Bug 1562722)
+  aWGP->DrawSnapshotInternal(this, aRect, mScale, mBackgroundColor);
   mPendingFragments += 1;
 }
 
 void CrossProcessPaint::Clear() {
   mPromise = nullptr;
   mPendingFragments = 0;
   mReceivedFragments.Clear();
 }
 
 bool CrossProcessPaint::IsCleared() const { return !mPromise; }
 
+static dom::TabId GetTabId(dom::WindowGlobalParent* aWGP) {
+  // There is no unique TabId for a given WindowGlobalParent, as multiple
+  // WindowGlobalParents share the same PBrowser actor. However, we only
+  // ever queue one paint per PBrowser by just using the current
+  // WindowGlobalParent for a PBrowser. So we can interchange TabId and
+  // WindowGlobalParent when dealing with resolving surfaces.
+  RefPtr<dom::BrowserParent> browserParent = aWGP->GetBrowserParent();
+  return browserParent ? browserParent->GetTabId() : dom::TabId(0);
+}
+
 void CrossProcessPaint::MaybeResolve() {
   // Don't do anything if we aren't ready, experienced an error, or already
   // resolved this paint
   if (IsCleared() || mPendingFragments > 0) {
     CPP_LOG("Not ready to resolve yet, have %u fragments left.\n",
             mPendingFragments);
     return;
   }
 
   CPP_LOG("Starting to resolve fragments.\n");
 
   // Resolve the paint fragments from the bottom up
   ResolvedSurfaceMap resolved;
-  if (!ResolveInternal(mRootId, &resolved)) {
+  if (!ResolveInternal(mRoot, &resolved)) {
     CPP_LOG("Couldn't resolve.\n");
 
     mPromise->MaybeReject(NS_ERROR_FAILURE);
     Clear();
     return;
   }
 
-  // Grab the result from the resolved table
-  RefPtr<SourceSurface> root = resolved.Get(mRootId);
+  // Grab the result from the resolved table.
+  RefPtr<SourceSurface> root = resolved.Get(GetTabId(mRoot));
   CPP_LOG("Resolved all fragments.\n");
 
   ErrorResult rv;
   RefPtr<dom::ImageBitmap> bitmap = dom::ImageBitmap::CreateFromSourceSurface(
       mPromise->GetParentObject(), root, rv);
 
   if (!rv.Failed()) {
     CPP_LOG("Success, fulfilling promise.\n");
     mPromise->MaybeResolve(bitmap);
   } else {
     CPP_LOG("Couldn't create ImageBitmap for SourceSurface.\n");
     mPromise->MaybeReject(rv);
   }
   Clear();
 }
 
-bool CrossProcessPaint::ResolveInternal(dom::TabId aId,
+bool CrossProcessPaint::ResolveInternal(dom::WindowGlobalParent* aWGP,
                                         ResolvedSurfaceMap* aResolved) {
+  // Convert aWGP to an ID we can use for surfaces
+  dom::TabId surfaceId = GetTabId(aWGP);
+
   // We should not have resolved this paint already
-  MOZ_ASSERT(!aResolved->GetWeak(aId));
+  MOZ_ASSERT(!aResolved->GetWeak(surfaceId));
 
-  CPP_LOG("Resolving fragment %llu.\n", (uint64_t)aId);
+  CPP_LOG("Resolving fragment %p.\n", aWGP);
 
-  Maybe<PaintFragment> fragment = mReceivedFragments.GetAndRemove(aId);
+  Maybe<PaintFragment> fragment = mReceivedFragments.GetAndRemove(aWGP);
 
   // Rasterize all the dependencies first so that we can resolve this fragment
   for (auto iter = fragment->mDependencies.Iter(); !iter.Done(); iter.Next()) {
-    auto dependency = iter.Get()->GetKey();
-    if (!ResolveInternal(dom::TabId(dependency), aResolved)) {
+    auto dependency = dom::TabId(iter.Get()->GetKey());
+
+    dom::ContentProcessManager* cpm =
+        dom::ContentProcessManager::GetSingleton();
+    dom::ContentParentId cpId = cpm->GetTabProcessId(dependency);
+    RefPtr<dom::BrowserParent> tab =
+        cpm->GetBrowserParentByProcessAndTabId(cpId, dependency);
+    RefPtr<dom::WindowGlobalParent> wgp =
+        tab->GetBrowsingContext()->GetCurrentWindowGlobal();
+
+    if (!ResolveInternal(wgp, aResolved)) {
       return false;
     }
   }
 
   // Create the destination draw target
   RefPtr<DrawTarget> drawTarget =
       gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
           fragment->mSize, SurfaceFormat::B8G8R8A8);
   if (!drawTarget || !drawTarget->IsValid()) {
-    CPP_LOG("Couldn't create (%d x %d) surface for fragment %llu.\n",
-            fragment->mSize.width, fragment->mSize.height, (uint64_t)aId);
+    CPP_LOG("Couldn't create (%d x %d) surface for fragment %p.\n",
+            fragment->mSize.width, fragment->mSize.height, aWGP);
     return false;
   }
 
   // Translate the recording using our child tabs
   {
     InlineTranslator translator(drawTarget, nullptr);
     translator.SetExternalSurfaces(aResolved);
     if (!translator.TranslateRecording((char*)fragment->mRecording.mData,
                                        fragment->mRecording.mLen)) {
-      CPP_LOG("Couldn't translate recording for fragment %llu.\n",
-              (uint64_t)aId);
+      CPP_LOG("Couldn't translate recording for fragment %p.\n", aWGP);
       return false;
     }
   }
 
   RefPtr<SourceSurface> snapshot = drawTarget->Snapshot();
   if (!snapshot) {
-    CPP_LOG("Couldn't get snapshot for fragment %llu.\n", (uint64_t)aId);
+    CPP_LOG("Couldn't get snapshot for fragment %p.\n", aWGP);
     return false;
   }
 
   // We are done with the resolved images of our dependencies, let's remove
   // them
   for (auto iter = fragment->mDependencies.Iter(); !iter.Done(); iter.Next()) {
     auto dependency = iter.Get()->GetKey();
     aResolved->Remove(dependency);
   }
 
-  aResolved->Put(aId, snapshot);
+  aResolved->Put(surfaceId, snapshot);
   return true;
 }
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/ipc/CrossProcessPaint.h
+++ b/gfx/ipc/CrossProcessPaint.h
@@ -5,29 +5,36 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef _include_mozilla_gfx_ipc_CrossProcessPaint_h_
 #define _include_mozilla_gfx_ipc_CrossProcessPaint_h_
 
 #include "nsISupportsImpl.h"
 
 #include "mozilla/dom/ipc/IdType.h"
 #include "mozilla/dom/Promise.h"
+#include "mozilla/dom/DOMRect.h"
 #include "mozilla/gfx/2D.h"
+#include "mozilla/Maybe.h"
 #include "mozilla/ipc/ByteBuf.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "nsRefPtrHashtable.h"
 #include "nsTHashtable.h"
 
 namespace IPC {
 template <typename T>
 struct ParamTraits;
 }  // namespace IPC
 
 namespace mozilla {
+
+namespace dom {
+class WindowGlobalParent;
+}  // namespace dom
+
 namespace gfx {
 
 class CrossProcessPaint;
 
 /**
  * A fragment of a paint of a cross process document tree.
  */
 class PaintFragment final {
@@ -35,27 +42,29 @@ class PaintFragment final {
   /// Initializes an empty PaintFragment
   PaintFragment() = default;
 
   /**
    * Creates a paint fragment by recording the draw commands and dependent tabs
    * for an nsIDocShell.
    *
    * @param aDocShell The document shell to record.
-   * @param aRect The rectangle relative to the viewport to use.
+   * @param aRect The rectangle relative to the viewport to use. If no
+   *   rectangle is specified, then the whole viewport will be used.
    * @param aScale The coordinate scale to use. The size of the resolved
    *   surface will be `aRect.Size() * aScale`, with aScale clamped to
    *   at least kMinPaintScale.
    * @param aBackgroundColor The background color to use.
    *
    * @return A paint fragment. The paint fragment may be `empty` if rendering
    *         was unable to be accomplished for some reason.
    */
-  static PaintFragment Record(nsIDocShell* aDocShell, const IntRect& aRect,
-                              float aScale, nscolor aBackgroundColor);
+  static PaintFragment Record(nsIDocShell* aDocShell,
+                              const Maybe<IntRect>& aRect, float aScale,
+                              nscolor aBackgroundColor);
 
   /// Returns whether this paint fragment contains a valid recording.
   bool IsEmpty() const;
 
   PaintFragment(PaintFragment&&) = default;
   PaintFragment& operator=(PaintFragment&&) = default;
 
  protected:
@@ -75,81 +84,68 @@ class PaintFragment final {
  * An object for painting a cross process document tree.
  */
 class CrossProcessPaint final {
   NS_INLINE_DECL_REFCOUNTING(CrossProcessPaint);
 
  public:
   /**
    * Begin an asynchronous paint of a cross process document tree starting at
-   * a local document shell. The local document will be painted, then async
-   * paints will be queued for remote subframes. Once all subframes have been
-   * recorded, the final image will be resolved, and the promise will be
-   * resolved with a dom::ImageBitmap.
+   * a WindowGlobalParent. A maybe-async paint for the root WGP will be done,
+   * then async paints will be recursively queued for remote subframes. Once
+   * all subframes have been recorded, the final image will be resolved, and
+   * the promise will be resolved with a dom::ImageBitmap.
    *
-   * @param aDocShell The document shell to paint.
-   * @param aRect The rectangle relative to the viewport to use.
+   * @param aRoot The WindowGlobalParent to paint.
+   * @param aRect The rectangle relative to the viewport to use, or null to
+   *   render the whole viewport.
    * @param aScale The coordinate scale to use. The size of the resolved
    *   surface will be `aRect.Size() * aScale`, with aScale clamped to
    *   at least kMinPaintScale. See the implementation for the current
    *   minimum value.
    * @param aBackgroundColor The background color to use.
    * @param aPromise The promise to resolve with a dom::ImageBitmap.
+   *
+   * @returns Whether the paint was able to be initiated or not.
    */
-  static void StartLocal(nsIDocShell* aRoot, const IntRect& aRect, float aScale,
-                         nscolor aBackgroundColor, dom::Promise* aPromise);
+  static bool Start(dom::WindowGlobalParent* aRoot, const dom::DOMRect* aRect,
+                    float aScale, nscolor aBackgroundColor,
+                    dom::Promise* aPromise);
 
-  /**
-   * Begin an asynchronous paint of a cross process document tree starting at
-   * a remote tab. An async paint for the remote tab will be queued, then async
-   * paints will be recursively queued for remote subframes. Once all subframes
-   * have been recorded, the final image will be resolved, and the promise will
-   * be resolved with a dom::ImageBitmap.
-   *
-   * @param aDocShell The document shell to paint.
-   * @param aRect The rectangle relative to the viewport to use.
-   * @param aScale The coordinate scale to use. The size of the resolved
-   *   surface will be `aRect.Size() * aScale`, with aScale clamped to
-   *   at least kMinPaintScale. See the implementation for the current
-   *   minimum value.
-   * @param aBackgroundColor The background color to use.
-   * @param aPromise The promise to resolve with a dom::ImageBitmap.
-   */
-  static void StartRemote(dom::TabId aRoot, const IntRect& aRect, float aScale,
-                          nscolor aBackgroundColor, dom::Promise* aPromise);
-
-  void ReceiveFragment(dom::TabId aId, PaintFragment&& aFragment);
-  void LostFragment(dom::TabId aId);
+  void ReceiveFragment(dom::WindowGlobalParent* aWGP,
+                       PaintFragment&& aFragment);
+  void LostFragment(dom::WindowGlobalParent* aWGP);
 
  private:
   typedef nsRefPtrHashtable<nsUint64HashKey, SourceSurface> ResolvedSurfaceMap;
-  typedef nsDataHashtable<nsUint64HashKey, PaintFragment> ReceivedFragmentMap;
+  typedef nsDataHashtable<nsRefPtrHashKey<dom::WindowGlobalParent>,
+                          PaintFragment>
+      ReceivedFragmentMap;
 
   CrossProcessPaint(dom::Promise* aPromise, float aScale,
-                    nscolor aBackgroundColor, dom::TabId aRootId);
+                    nscolor aBackgroundColor, dom::WindowGlobalParent* aRoot);
   ~CrossProcessPaint();
 
-  void QueueRootPaint(dom::TabId aId, const IntRect& aRect, float aScale,
-                      nscolor aBackgroundColor);
-  void QueueSubPaint(dom::TabId aId);
+  void QueuePaint(dom::WindowGlobalParent* aWGP, const Maybe<IntRect>& aRect);
 
   /// Clear the state of this paint so that it cannot be resolved or receive
   /// any paint fragments.
   void Clear();
 
   /// Returns if this paint has been cleared.
   bool IsCleared() const;
 
   /// Resolves the paint fragments if we have none pending and resolves the
   /// promise.
   void MaybeResolve();
-  bool ResolveInternal(dom::TabId aId, ResolvedSurfaceMap* aResolved);
+  bool ResolveInternal(dom::WindowGlobalParent* aWGP,
+                       ResolvedSurfaceMap* aResolved);
 
   RefPtr<dom::Promise> mPromise;
-  dom::TabId mRootId;
+  RefPtr<dom::WindowGlobalParent> mRoot;
   float mScale;
   nscolor mBackgroundColor;
   uint32_t mPendingFragments;
   ReceivedFragmentMap mReceivedFragments;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/ipc/GPUChild.cpp
+++ b/gfx/ipc/GPUChild.cpp
@@ -171,37 +171,37 @@ mozilla::ipc::IPCResult GPUChild::RecvNo
   MOZ_ASSERT(obsSvc);
   if (obsSvc) {
     obsSvc->NotifyObservers(nullptr, aTopic.get(), nullptr);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvAccumulateChildHistograms(
-    InfallibleTArray<HistogramAccumulation>&& aAccumulations) {
+    nsTArray<HistogramAccumulation>&& aAccumulations) {
   TelemetryIPC::AccumulateChildHistograms(Telemetry::ProcessID::Gpu,
                                           aAccumulations);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvAccumulateChildKeyedHistograms(
-    InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations) {
+    nsTArray<KeyedHistogramAccumulation>&& aAccumulations) {
   TelemetryIPC::AccumulateChildKeyedHistograms(Telemetry::ProcessID::Gpu,
                                                aAccumulations);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvUpdateChildScalars(
-    InfallibleTArray<ScalarAction>&& aScalarActions) {
+    nsTArray<ScalarAction>&& aScalarActions) {
   TelemetryIPC::UpdateChildScalars(Telemetry::ProcessID::Gpu, aScalarActions);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvUpdateChildKeyedScalars(
-    InfallibleTArray<KeyedScalarAction>&& aScalarActions) {
+    nsTArray<KeyedScalarAction>&& aScalarActions) {
   TelemetryIPC::UpdateChildKeyedScalars(Telemetry::ProcessID::Gpu,
                                         aScalarActions);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvRecordChildEvents(
     nsTArray<mozilla::Telemetry::ChildEventData>&& aEvents) {
   TelemetryIPC::RecordChildEvents(Telemetry::ProcessID::Gpu, aEvents);
--- a/gfx/ipc/GPUChild.h
+++ b/gfx/ipc/GPUChild.h
@@ -46,23 +46,23 @@ class GPUChild final : public PGPUChild,
   mozilla::ipc::IPCResult RecvReportCheckerboard(const uint32_t& aSeverity,
                                                  const nsCString& aLog);
   mozilla::ipc::IPCResult RecvInitCrashReporter(
       Shmem&& shmem, const NativeThreadId& aThreadId);
   mozilla::ipc::IPCResult RecvCreateVRProcess();
   mozilla::ipc::IPCResult RecvShutdownVRProcess();
 
   mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
-      InfallibleTArray<HistogramAccumulation>&& aAccumulations);
+      nsTArray<HistogramAccumulation>&& aAccumulations);
   mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
-      InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations);
+      nsTArray<KeyedHistogramAccumulation>&& aAccumulations);
   mozilla::ipc::IPCResult RecvUpdateChildScalars(
-      InfallibleTArray<ScalarAction>&& aScalarActions);
+      nsTArray<ScalarAction>&& aScalarActions);
   mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
-      InfallibleTArray<KeyedScalarAction>&& aScalarActions);
+      nsTArray<KeyedScalarAction>&& aScalarActions);
   mozilla::ipc::IPCResult RecvRecordChildEvents(
       nsTArray<ChildEventData>&& events);
   mozilla::ipc::IPCResult RecvRecordDiscardedData(
       const DiscardedData& aDiscardedData);
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
   mozilla::ipc::IPCResult RecvGraphicsError(const nsCString& aError);
   mozilla::ipc::IPCResult RecvNotifyUiObservers(const nsCString& aTopic);
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -445,16 +445,21 @@ void GPUProcessManager::DisableWebRender
             gfx::FeatureStatus::Unavailable,
             "Failed to make render context current",
             NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBRENDER_MAKE_CURRENT"));
   } else if (aError == wr::WebRenderError::RENDER) {
     gfx::gfxConfig::GetFeature(gfx::Feature::WEBRENDER)
         .ForceDisable(gfx::FeatureStatus::Unavailable,
                       "Failed to render WebRender",
                       NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBRENDER_RENDER"));
+  } else if (aError == wr::WebRenderError::NEW_SURFACE) {
+    gfx::gfxConfig::GetFeature(gfx::Feature::WEBRENDER)
+        .ForceDisable(
+            gfx::FeatureStatus::Unavailable, "Failed to create new surface",
+            NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBRENDER_NEW_SURFACE"));
   } else {
     MOZ_ASSERT_UNREACHABLE("Invalid value");
   }
   gfx::gfxVars::SetUseWebRender(false);
 
 #if defined(MOZ_WIDGET_ANDROID)
   // If aError is not wr::WebRenderError::INITIALIZE, nsWindow does not
   // re-create LayerManager. Needs to trigger re-creating LayerManager on
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -44,17 +44,17 @@
 #include "nsCOMPtr.h"                // for already_AddRefed
 #include "nsCSSPropertyID.h"         // for nsCSSPropertyID
 #include "nsDebug.h"                 // for NS_ASSERTION
 #include "nsISupportsImpl.h"         // for Layer::Release, etc
 #include "nsRect.h"                  // for mozilla::gfx::IntRect
 #include "nsRegion.h"                // for nsIntRegion
 #include "nsString.h"                // for nsCString
 #include "nsTArray.h"                // for nsTArray
-#include "nsTArrayForwardDeclare.h"  // for InfallibleTArray
+#include "nsTArrayForwardDeclare.h"  // for nsTArray
 #include "nscore.h"                  // for nsACString, nsAString
 #include "mozilla/Logging.h"         // for PRLogModuleInfo
 #include "nsIWidget.h"  // For plugin window configuration information structs
 #include "ImageContainer.h"
 
 class gfxContext;
 class nsDisplayListBuilder;
 class nsDisplayItem;
--- a/gfx/layers/apz/test/mochitest/apz_test_utils.js
+++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js
@@ -196,28 +196,31 @@ function isLayerized(elementId) {
     }
   }
   return false;
 }
 
 function promiseApzRepaintsFlushed(aWindow = window) {
   return new Promise(function(resolve, reject) {
     var repaintDone = function() {
+      dump("PromiseApzRepaintsFlushed: APZ flush done\n");
       SpecialPowers.Services.obs.removeObserver(
         repaintDone,
         "apz-repaints-flushed"
       );
       setTimeout(resolve, 0);
     };
     SpecialPowers.Services.obs.addObserver(repaintDone, "apz-repaints-flushed");
     if (SpecialPowers.getDOMWindowUtils(aWindow).flushApzRepaints()) {
-      dump("Flushed APZ repaints, waiting for callback...\n");
+      dump(
+        "PromiseApzRepaintsFlushed: Flushed APZ repaints, waiting for callback...\n"
+      );
     } else {
       dump(
-        "Flushing APZ repaints was a no-op, triggering callback directly...\n"
+        "PromiseApzRepaintsFlushed: Flushing APZ repaints was a no-op, triggering callback directly...\n"
       );
       repaintDone();
     }
   });
 }
 
 function flushApzRepaints(aCallback, aWindow = window) {
   if (!aCallback) {
@@ -465,36 +468,37 @@ async function waitUntilApzStable() {
         );
         var topWin = Services.wm.getMostRecentWindow("navigator:browser");
         if (!topWin) {
           topWin = Services.wm.getMostRecentWindow("navigator:geckoview");
         }
         var topUtils = topWin.windowUtils;
 
         var repaintDone = function() {
+          dump("WaitUntilApzStable: APZ flush done in parent proc\n");
           Services.obs.removeObserver(repaintDone, "apz-repaints-flushed");
           // send message back to content process
           sendAsyncMessage("apz-flush-done", null);
         };
         var flushRepaint = function() {
           if (topUtils.isMozAfterPaintPending) {
             topWin.addEventListener("MozAfterPaint", flushRepaint, {
               once: true,
             });
             return;
           }
 
           Services.obs.addObserver(repaintDone, "apz-repaints-flushed");
           if (topUtils.flushApzRepaints()) {
             dump(
-              "Parent process: flushed APZ repaints, waiting for callback...\n"
+              "WaitUntilApzStable: flushed APZ repaints in parent proc, waiting for callback...\n"
             );
           } else {
             dump(
-              "Parent process: flushing APZ repaints was a no-op, triggering callback directly...\n"
+              "WaitUntilApzStable: flushing APZ repaints in parent proc was a no-op, triggering callback directly...\n"
             );
             repaintDone();
           }
         };
 
         // Flush APZ repaints, but wait until all the pending paints have been
         // sent.
         flushRepaint();
@@ -517,21 +521,25 @@ async function waitUntilApzStable() {
         waitUntilApzStable.chromeHelper.destroy();
         delete waitUntilApzStable.chromeHelper;
       });
     }
 
     // Actually trigger the parent-process flush and wait for it to finish
     waitUntilApzStable.chromeHelper.sendAsyncMessage("apz-flush", null);
     await waitUntilApzStable.chromeHelper.promiseOneMessage("apz-flush-done");
+    dump("WaitUntilApzStable: got apz-flush-done in child proc\n");
   }
 
   await SimpleTest.promiseFocus(window);
+  dump("WaitUntilApzStable: done promiseFocus\n");
   await promiseAllPaintsDone();
+  dump("WaitUntilApzStable: done promiseAllPaintsDone\n");
   await promiseApzRepaintsFlushed();
+  dump("WaitUntilApzStable: all done\n");
 }
 
 // This function returns a promise that is resolved after at least one paint
 // has been sent and processed by the compositor. This function can force
 // such a paint to happen if none are pending. This is useful to run after
 // the waitUntilApzStable() but before reading the compositor-side APZ test
 // data, because the test data for the content layers id only gets populated
 // on content layer tree updates *after* the root layer tree has a RefLayer
--- a/gfx/layers/apz/test/mochitest/mochitest.ini
+++ b/gfx/layers/apz/test/mochitest/mochitest.ini
@@ -1,9 +1,11 @@
 [DEFAULT]
+  prefs =
+    testing.paint_listener.debug=true
   support-files =
     apz_test_native_event_utils.js
     apz_test_utils.js
     helper_*.*
   tags = apz
 [test_bug982141.html]
 [test_bug1151663.html]
 [test_bug1151667.html]
--- a/gfx/layers/client/MultiTiledContentClient.cpp
+++ b/gfx/layers/client/MultiTiledContentClient.cpp
@@ -57,17 +57,17 @@ ClientMultiTiledLayerBuffer::ClientMulti
 void ClientMultiTiledLayerBuffer::DiscardBuffers() {
   for (TileClient& tile : mRetainedTiles) {
     tile.DiscardBuffers();
   }
 }
 
 SurfaceDescriptorTiles
 ClientMultiTiledLayerBuffer::GetSurfaceDescriptorTiles() {
-  InfallibleTArray<TileDescriptor> tiles;
+  nsTArray<TileDescriptor> tiles;
 
   for (TileClient& tile : mRetainedTiles) {
     TileDescriptor tileDesc = tile.GetTileDescriptor();
     tiles.AppendElement(tileDesc);
     // Reset the update rect
     tile.mUpdateRect = IntRect();
   }
   return SurfaceDescriptorTiles(
--- a/gfx/layers/client/SingleTiledContentClient.cpp
+++ b/gfx/layers/client/SingleTiledContentClient.cpp
@@ -58,17 +58,17 @@ void ClientSingleTiledLayerBuffer::Disca
   if (!mTile.IsPlaceholderTile()) {
     mTile.DiscardFrontBuffer();
     mTile.DiscardBackBuffer();
   }
 }
 
 SurfaceDescriptorTiles
 ClientSingleTiledLayerBuffer::GetSurfaceDescriptorTiles() {
-  InfallibleTArray<TileDescriptor> tiles;
+  nsTArray<TileDescriptor> tiles;
 
   TileDescriptor tileDesc = mTile.GetTileDescriptor();
   tiles.AppendElement(tileDesc);
   mTile.mUpdateRect = gfx::IntRect();
 
   return SurfaceDescriptorTiles(mValidRegion, tiles, mTilingOrigin, mSize, 0, 0,
                                 1, 1, 1.0, mFrameResolution.xScale,
                                 mFrameResolution.yScale,
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -28,17 +28,17 @@
 #include "nsDebug.h"                 // for NS_ASSERTION, etc
 #include "nsDeviceContext.h"         // for nsDeviceContext
 #include "nsDisplayList.h"           // for nsDisplayTransform, etc
 #include "nsMathUtils.h"             // for NS_round
 #include "nsPoint.h"                 // for nsPoint
 #include "nsRect.h"                  // for mozilla::gfx::IntRect
 #include "nsRegion.h"                // for nsIntRegion
 #include "nsTArray.h"                // for nsTArray, nsTArray_Impl, etc
-#include "nsTArrayForwardDeclare.h"  // for InfallibleTArray
+#include "nsTArrayForwardDeclare.h"  // for nsTArray
 #include "UnitTransforms.h"          // for TransformTo
 #if defined(MOZ_WIDGET_ANDROID)
 #  include <android/log.h>
 #  include "mozilla/layers/UiCompositorControllerParent.h"
 #  include "mozilla/widget/AndroidCompositorWidget.h"
 #endif
 #include "GeckoProfiler.h"
 #include "FrameUniformityData.h"
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -225,16 +225,20 @@ already_AddRefed<TextureHost> TextureHos
       result = TextureHost::Create(*realDesc, aReadLock, aDeallocator, aBackend,
                                    aFlags, aExternalImageId);
       return result.forget();
     }
     default:
       MOZ_CRASH("GFX: Unsupported Surface type host");
   }
 
+  if (!result) {
+    gfxCriticalNote << "TextureHost creation failure type=" << aDesc.type();
+  }
+
   if (result && WrapWithWebRenderTextureHost(aDeallocator, aBackend, aFlags)) {
     MOZ_ASSERT(aExternalImageId.isSome());
     result =
         new WebRenderTextureHost(aDesc, aFlags, result, aExternalImageId.ref());
   }
 
   if (result) {
     result->DeserializeReadLock(aReadLock, aDeallocator);
--- a/gfx/layers/composite/TiledContentHost.cpp
+++ b/gfx/layers/composite/TiledContentHost.cpp
@@ -259,17 +259,17 @@ bool TiledLayerBufferComposite::UseTiles
     // There are divisions by mResolution so this protects the compositor
     // process against malicious content processes and fuzzing.
     return false;
   }
 
   TilesPlacement newTiles(aTiles.firstTileX(), aTiles.firstTileY(),
                           aTiles.retainedWidth(), aTiles.retainedHeight());
 
-  const InfallibleTArray<TileDescriptor>& tileDescriptors = aTiles.tiles();
+  const nsTArray<TileDescriptor>& tileDescriptors = aTiles.tiles();
 
   TextureSourceRecycler oldRetainedTiles(std::move(mRetainedTiles));
   mRetainedTiles.SetLength(tileDescriptors.Length());
 
   AutoTArray<uint64_t, 10> lockedTextureSerials;
   base::ProcessId lockedTexturePid = 0;
 
   // Step 1, deserialize the incoming set of tiles into mRetainedTiles, and
--- a/gfx/layers/ipc/CanvasChild.cpp
+++ b/gfx/layers/ipc/CanvasChild.cpp
@@ -4,16 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CanvasChild.h"
 
 #include "MainThreadUtils.h"
 #include "mozilla/gfx/DrawTargetRecording.h"
 #include "mozilla/gfx/Tools.h"
+#include "mozilla/gfx/Rect.h"
+#include "mozilla/gfx/Point.h"
 #include "mozilla/layers/CanvasDrawEventRecorder.h"
 #include "RecordedCanvasEventImpl.h"
 
 namespace mozilla {
 namespace layers {
 
 static const TimeDuration kLockWaitTimeout =
     TimeDuration::FromMilliseconds(100);
@@ -99,17 +101,17 @@ void CanvasChild::EndTransaction() {
 
 already_AddRefed<gfx::DrawTarget> CanvasChild::CreateDrawTarget(
     gfx::IntSize aSize, gfx::SurfaceFormat aFormat) {
   MOZ_ASSERT(mRecorder);
 
   RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget(
       gfx::BackendType::SKIA, gfx::IntSize(1, 1), aFormat);
   RefPtr<gfx::DrawTarget> dt =
-      MakeAndAddRef<gfx::DrawTargetRecording>(mRecorder, dummyDt, aSize);
+      MakeAndAddRef<gfx::DrawTargetRecording>(mRecorder, dummyDt, gfx::IntRect(gfx::IntPoint(0, 0), aSize));
   return dt.forget();
 }
 
 void CanvasChild::RecordEvent(const gfx::RecordedEvent& aEvent) {
   mRecorder->RecordEvent(aEvent);
 }
 
 already_AddRefed<gfx::DataSourceSurface> CanvasChild::GetDataSurface(
--- a/gfx/layers/ipc/CompositableTransactionParent.cpp
+++ b/gfx/layers/ipc/CompositableTransactionParent.cpp
@@ -111,18 +111,17 @@ bool CompositableParentManager::ReceiveC
       TiledContentHost* tiledHost = aCompositable->AsTiledContentHost();
 
       NS_ASSERTION(tiledHost, "The compositable is not tiled");
 
       const SurfaceDescriptorTiles& tileDesc = op.tileLayerDescriptor();
 
       bool success = tiledHost->UseTiledLayerBuffer(this, tileDesc);
 
-      const InfallibleTArray<TileDescriptor>& tileDescriptors =
-          tileDesc.tiles();
+      const nsTArray<TileDescriptor>& tileDescriptors = tileDesc.tiles();
       for (size_t i = 0; i < tileDescriptors.Length(); i++) {
         const TileDescriptor& tileDesc = tileDescriptors[i];
         if (tileDesc.type() != TileDescriptor::TTexturedTileDescriptor) {
           continue;
         }
         const TexturedTileDescriptor& texturedDesc =
             tileDesc.get_TexturedTileDescriptor();
         RefPtr<TextureHost> texture =
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -797,17 +797,17 @@ PTextureChild* CompositorBridgeChild::Al
   return TextureClient::CreateIPDLActor();
 }
 
 bool CompositorBridgeChild::DeallocPTextureChild(PTextureChild* actor) {
   return TextureClient::DestroyIPDLActor(actor);
 }
 
 mozilla::ipc::IPCResult CompositorBridgeChild::RecvParentAsyncMessages(
-    InfallibleTArray<AsyncParentMessageData>&& aMessages) {
+    nsTArray<AsyncParentMessageData>&& aMessages) {
   for (AsyncParentMessageArray::index_type i = 0; i < aMessages.Length(); ++i) {
     const AsyncParentMessageData& message = aMessages[i];
 
     switch (message.type()) {
       case AsyncParentMessageData::TOpNotifyNotUsed: {
         const OpNotifyNotUsed& op = message.get_OpNotifyNotUsed();
         NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
         break;
--- a/gfx/layers/ipc/CompositorBridgeChild.h
+++ b/gfx/layers/ipc/CompositorBridgeChild.h
@@ -47,17 +47,17 @@ class CompositorBridgeParent;
 class CompositorManagerChild;
 class CompositorOptions;
 class TextureClient;
 class TextureClientPool;
 struct FrameMetrics;
 
 class CompositorBridgeChild final : public PCompositorBridgeChild,
                                     public TextureForwarder {
-  typedef InfallibleTArray<AsyncParentMessageData> AsyncParentMessageArray;
+  typedef nsTArray<AsyncParentMessageData> AsyncParentMessageArray;
 
   friend class PCompositorBridgeChild;
 
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorBridgeChild, override);
 
   explicit CompositorBridgeChild(CompositorManagerChild* aManager);
 
@@ -110,17 +110,17 @@ class CompositorBridgeChild final : publ
       const SurfaceDescriptor& aSharedData, const ReadLockDescriptor& aReadLock,
       const LayersBackend& aLayersBackend, const TextureFlags& aFlags,
       const LayersId& aId, const uint64_t& aSerial,
       const wr::MaybeExternalImageId& aExternalImageId);
 
   bool DeallocPTextureChild(PTextureChild* actor);
 
   mozilla::ipc::IPCResult RecvParentAsyncMessages(
-      InfallibleTArray<AsyncParentMessageData>&& aMessages);
+      nsTArray<AsyncParentMessageData>&& aMessages);
   PTextureChild* CreateTexture(const SurfaceDescriptor& aSharedData,
                                const ReadLockDescriptor& aReadLock,
                                LayersBackend aLayersBackend,
                                TextureFlags aFlags, uint64_t aSerial,
                                wr::MaybeExternalImageId& aExternalImageId,
                                nsIEventTarget* aTarget) override;
 
   already_AddRefed<CanvasChild> GetCanvasChild() final;
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -146,17 +146,17 @@ void CompositorBridgeParentBase::NotifyN
     return;
   }
 
   uint64_t textureId = TextureHost::GetTextureSerial(aTexture);
   mPendingAsyncMessage.push_back(OpNotifyNotUsed(textureId, aTransactionId));
 }
 
 void CompositorBridgeParentBase::SendAsyncMessage(
-    const InfallibleTArray<AsyncParentMessageData>& aMessage) {
+    const nsTArray<AsyncParentMessageData>& aMessage) {
   Unused << SendParentAsyncMessages(aMessage);
 }
 
 bool CompositorBridgeParentBase::AllocShmem(
     size_t aSize, ipc::SharedMemory::SharedMemoryType aType,
     ipc::Shmem* aShmem) {
   return PCompositorBridgeParent::AllocShmem(aSize, aType, aShmem);
 }
@@ -399,17 +399,17 @@ void CompositorBridgeParent::Initialize(
 }
 
 LayersId CompositorBridgeParent::RootLayerTreeId() {
   MOZ_ASSERT(mRootLayerTreeID.IsValid());
   return mRootLayerTreeID;
 }
 
 CompositorBridgeParent::~CompositorBridgeParent() {
-  InfallibleTArray<PTextureParent*> textures;
+  nsTArray<PTextureParent*> textures;
   ManagedPTextureParent(textures);
   // We expect all textures to be destroyed by now.
   MOZ_DIAGNOSTIC_ASSERT(textures.Length() == 0);
   for (unsigned int i = 0; i < textures.Length(); ++i) {
     RefPtr<TextureHost> tex = TextureHost::AsTextureHost(textures[i]);
     tex->DeallocateDeviceData();
   }
 }
@@ -613,17 +613,17 @@ mozilla::ipc::IPCResult CompositorBridge
     *aOutStartIndex = mWrBridge->StartFrameTimeRecording(aBufferSize);
   } else {
     *aOutStartIndex = 0;
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult CompositorBridgeParent::RecvStopFrameTimeRecording(
-    const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) {
+    const uint32_t& aStartIndex, nsTArray<float>* intervals) {
   if (mLayerManager) {
     mLayerManager->StopFrameTimeRecording(aStartIndex, *intervals);
   } else if (mWrBridge) {
     mWrBridge->StopFrameTimeRecording(aStartIndex, *intervals);
   }
   return IPC_OK();
 }
 
@@ -1772,33 +1772,33 @@ PWebRenderBridgeParent* CompositorBridge
     // before the updater thread is created in WebRenderAPI::Create, so
     // that the callback from the updater thread can find the right APZUpdater.
     mApzUpdater->SetWebRenderWindowId(windowId);
   }
   if (mApzSampler) {
     // Same as for mApzUpdater, but for the sampler thread.
     mApzSampler->SetWebRenderWindowId(windowId);
   }
-  InfallibleTArray<RefPtr<wr::WebRenderAPI>> apis;
+  nsTArray<RefPtr<wr::WebRenderAPI>> apis;
   apis.AppendElement(
       wr::WebRenderAPI::Create(this, std::move(widget), windowId, aSize));
   if (!apis[0]) {
     mWrBridge = WebRenderBridgeParent::CreateDestroyed(aPipelineId);
     mWrBridge.get()->AddRef();  // IPDL reference
     return mWrBridge;
   }
 
   if (StaticPrefs::gfx_webrender_split_render_roots()) {
     apis.AppendElement(
         apis[0]->CreateDocument(aSize, 1, wr::RenderRoot::Content));
     apis.AppendElement(
         apis[0]->CreateDocument(aSize, 2, wr::RenderRoot::Popover));
   }
 
-  InfallibleTArray<RefPtr<wr::WebRenderAPI>> clonedApis;
+  nsTArray<RefPtr<wr::WebRenderAPI>> clonedApis;
   for (auto& api : apis) {
     wr::TransactionBuilder txn;
     txn.SetRootPipeline(aPipelineId);
     api->SendTransaction(txn);
     clonedApis.AppendElement(api->Clone());
   }
 
   mAsyncImageManager = new AsyncImagePipelineManager(std::move(clonedApis));
--- a/gfx/layers/ipc/CompositorBridgeParent.h
+++ b/gfx/layers/ipc/CompositorBridgeParent.h
@@ -157,17 +157,17 @@ class CompositorBridgeParentBase : publi
                                    LayersObserverEpoch aEpoch,
                                    bool aActive) = 0;
 
   // HostIPCAllocator
   base::ProcessId GetChildProcessId() override;
   void NotifyNotUsed(PTextureParent* aTexture,
                      uint64_t aTransactionId) override;
   void SendAsyncMessage(
-      const InfallibleTArray<AsyncParentMessageData>& aMessage) override;
+      const nsTArray<AsyncParentMessageData>& aMessage) override;
 
   // ShmemAllocator
   bool AllocShmem(size_t aSize,
                   mozilla::ipc::SharedMemory::SharedMemoryType aType,
                   mozilla::ipc::Shmem* aShmem) override;
   bool AllocUnsafeShmem(size_t aSize,
                         mozilla::ipc::SharedMemory::SharedMemoryType aType,
                         mozilla::ipc::Shmem* aShmem) override;
@@ -335,17 +335,17 @@ class CompositorBridgeParent final : pub
   mozilla::ipc::IPCResult RecvWaitOnTransactionProcessed() override;
   mozilla::ipc::IPCResult RecvForcePresent() override;
 
   mozilla::ipc::IPCResult RecvNotifyRegionInvalidated(
       const nsIntRegion& aRegion) override;
   mozilla::ipc::IPCResult RecvStartFrameTimeRecording(
       const int32_t& aBufferSize, uint32_t* aOutStartIndex) override;
   mozilla::ipc::IPCResult RecvStopFrameTimeRecording(
-      const uint32_t& aStartIndex, InfallibleTArray<float>* intervals) override;
+      const uint32_t& aStartIndex, nsTArray<float>* intervals) override;
 
   mozilla::ipc::IPCResult RecvCheckContentOnlyTDR(
       const uint32_t& sequenceNum, bool* isContentOnlyTDR) override {
     return IPC_OK();
   }
 
   // Unused for chrome <-> compositor communication (which this class does).
   // @see ContentCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint
--- a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
@@ -224,17 +224,17 @@ ContentCompositorBridgeParent::AllocPWeb
     MOZ_ASSERT(sIndirectLayerTrees.find(layersId) != sIndirectLayerTrees.end());
     MOZ_ASSERT(sIndirectLayerTrees[layersId].mWrBridge == nullptr);
     cbp = sIndirectLayerTrees[layersId].mParent;
     if (cbp) {
       root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWrBridge;
     }
   }
 
-  InfallibleTArray<RefPtr<wr::WebRenderAPI>> apis;
+  nsTArray<RefPtr<wr::WebRenderAPI>> apis;
   bool cloneSuccess = false;
   if (root) {
     cloneSuccess = root->CloneWebRenderAPIs(apis);
   }
 
   if (!cloneSuccess) {
     // This could happen when this function is called after
     // CompositorBridgeParent destruction. This was observed during Tab move
--- a/gfx/layers/ipc/ContentCompositorBridgeParent.h
+++ b/gfx/layers/ipc/ContentCompositorBridgeParent.h
@@ -71,18 +71,17 @@ class ContentCompositorBridgeParent fina
       const nsIntRegion& aRegion) override {
     return IPC_OK();
   }
   mozilla::ipc::IPCResult RecvStartFrameTimeRecording(
       const int32_t& aBufferSize, uint32_t* aOutStartIndex) override {
     return IPC_OK();
   }
   mozilla::ipc::IPCResult RecvStopFrameTimeRecording(
-      const uint32_t& aStartIndex,
-      InfallibleTArray<float>* intervals) override {
+      const uint32_t& aStartIndex, nsTArray<float>* intervals) override {
     return IPC_OK();
   }
 
   mozilla::ipc::IPCResult RecvCheckContentOnlyTDR(
       const uint32_t& sequenceNum, bool* isContentOnlyTDR) override;
 
   mozilla::ipc::IPCResult RecvAllPluginsCaptured() override { return IPC_OK(); }
 
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -46,17 +46,17 @@ void HostIPCAllocator::SendPendingAsyncM
 #if defined(OS_POSIX)
   static const uint32_t kMaxMessageNumber =
       FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE;
 #else
   // default number that works everywhere else
   static const uint32_t kMaxMessageNumber = 250;
 #endif
 
-  InfallibleTArray<AsyncParentMessageData> messages;
+  nsTArray<AsyncParentMessageData> messages;
   messages.SetCapacity(mPendingAsyncMessage.size());
   for (size_t i = 0; i < mPendingAsyncMessage.size(); i++) {
     messages.AppendElement(mPendingAsyncMessage[i]);
     // Limit maximum number of messages.
     if (messages.Length() >= kMaxMessageNumber) {
       SendAsyncMessage(messages);
       // Initialize Messages.
       messages.Clear();
--- a/gfx/layers/ipc/ISurfaceAllocator.h
+++ b/gfx/layers/ipc/ISurfaceAllocator.h
@@ -136,17 +136,17 @@ class HostIPCAllocator : public ISurface
    * Get child side's process Id.
    */
   virtual base::ProcessId GetChildProcessId() = 0;
 
   virtual void NotifyNotUsed(PTextureParent* aTexture,
                              uint64_t aTransactionId) = 0;
 
   virtual void SendAsyncMessage(
-      const InfallibleTArray<AsyncParentMessageData>& aMessage) = 0;
+      const nsTArray<AsyncParentMessageData>& aMessage) = 0;
 
   virtual void SendPendingAsyncMessages();
 
   virtual void SetAboutToSendAsyncMessages() {
     mAboutToSendAsyncMessages = true;
   }
 
   bool IsAboutToSendAsyncMessages() { return mAboutToSendAsyncMessages; }
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -179,17 +179,17 @@ void ImageBridgeChild::ShutdownStep1(Syn
   AutoCompleteTask complete(aTask);
 
   MOZ_ASSERT(InImageBridgeChildThread(),
              "Should be in ImageBridgeChild thread.");
 
   MediaSystemResourceManager::Shutdown();
 
   // Force all managed protocols to shut themselves down cleanly
-  InfallibleTArray<PTextureChild*> textures;
+  nsTArray<PTextureChild*> textures;
   ManagedPTextureChild(textures);
   for (int i = textures.Length() - 1; i >= 0; --i) {
     RefPtr<TextureClient> client = TextureClient::AsTextureClient(textures[i]);
     if (client) {
       client->Destroy();
     }
   }
 
@@ -880,17 +880,17 @@ ImageBridgeChild::AllocPMediaSystemResou
 bool ImageBridgeChild::DeallocPMediaSystemResourceManagerChild(
     PMediaSystemResourceManagerChild* aActor) {
   MOZ_ASSERT(aActor);
   delete static_cast<mozilla::media::MediaSystemResourceManagerChild*>(aActor);
   return true;
 }
 
 mozilla::ipc::IPCResult ImageBridgeChild::RecvParentAsyncMessages(
-    InfallibleTArray<AsyncParentMessageData>&& aMessages) {
+    nsTArray<AsyncParentMessageData>&& aMessages) {
   for (AsyncParentMessageArray::index_type i = 0; i < aMessages.Length(); ++i) {
     const AsyncParentMessageData& message = aMessages[i];
 
     switch (message.type()) {
       case AsyncParentMessageData::TOpNotifyNotUsed: {
         const OpNotifyNotUsed& op = message.get_OpNotifyNotUsed();
         NotifyNotUsed(op.TextureId(), op.fwdTransactionId());
         break;
@@ -910,17 +910,17 @@ RefPtr<ImageContainerListener> ImageBrid
   auto it = mImageContainerListeners.find(aHandle.Value());
   if (it != mImageContainerListeners.end()) {
     listener = it->second;
   }
   return listener;
 }
 
 mozilla::ipc::IPCResult ImageBridgeChild::RecvDidComposite(
-    InfallibleTArray<ImageCompositeNotification>&& aNotifications) {
+    nsTArray<ImageCompositeNotification>&& aNotifications) {
   for (auto& n : aNotifications) {
     RefPtr<ImageContainerListener> listener = FindListener(n.compositable());
     if (listener) {
       listener->NotifyComposite(n);
     }
   }
   return IPC_OK();
 }
--- a/gfx/layers/ipc/ImageBridgeChild.h
+++ b/gfx/layers/ipc/ImageBridgeChild.h
@@ -113,17 +113,17 @@ bool InImageBridgeChildThread();
  * thread is not used at all (except for the very first transaction that
  * provides the CompositableHost with an AsyncID).
  */
 class ImageBridgeChild final : public PImageBridgeChild,
                                public CompositableForwarder,
                                public TextureForwarder {
   friend class ImageContainer;
 
-  typedef InfallibleTArray<AsyncParentMessageData> AsyncParentMessageArray;
+  typedef nsTArray<AsyncParentMessageData> AsyncParentMessageArray;
 
  public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageBridgeChild, override);
 
   TextureForwarder* GetTextureForwarder() override { return this; }
   LayersIPCActor* GetLayersIPCActor() override { return this; }
 
   /**
@@ -187,20 +187,20 @@ class ImageBridgeChild final : public PI
 
   bool DeallocPTextureChild(PTextureChild* actor);
 
   PMediaSystemResourceManagerChild* AllocPMediaSystemResourceManagerChild();
   bool DeallocPMediaSystemResourceManagerChild(
       PMediaSystemResourceManagerChild* aActor);
 
   mozilla::ipc::IPCResult RecvParentAsyncMessages(
-      InfallibleTArray<AsyncParentMessageData>&& aMessages);
+      nsTArray<AsyncParentMessageData>&& aMessages);
 
   mozilla::ipc::IPCResult RecvDidComposite(
-      InfallibleTArray<ImageCompositeNotification>&& aNotifications);
+      nsTArray<ImageCompositeNotification>&& aNotifications);
 
   mozilla::ipc::IPCResult RecvReportFramesDropped(
       const CompositableHandle& aHandle, const uint32_t& aFrames);
 
   // Create an ImageClient from any thread.
   RefPtr<ImageClient> CreateImageClient(CompositableType aType,
                                         ImageContainer* aImageContainer);
 
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -25,17 +25,17 @@
 #include "mozilla/layers/TextureHostOGL.h"  // for TextureHostOGL
 #include "mozilla/layers/Compositor.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/mozalloc.h"  // for operator new, etc
 #include "mozilla/Unused.h"
 #include "nsDebug.h"                 // for NS_ASSERTION, etc
 #include "nsISupportsImpl.h"         // for ImageBridgeParent::Release, etc
 #include "nsTArray.h"                // for nsTArray, nsTArray_Impl