Merge m-c to fx-team, a=merge
authorWes Kocher <wkocher@mozilla.com>
Fri, 07 Aug 2015 17:36:14 -0700
changeset 288582 0366b96fc771908beca587ceabff16775c9cb8ce
parent 288581 02fd2b5d1df3648c15021952577ba264dea3352f (current diff)
parent 288543 943b79d9c65ff504b3d656d2188a29f6a42871c0 (diff)
child 288583 ce72fc6f687a6ac710e677015e62c51105814998
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c to fx-team, a=merge
modules/libpref/init/all.js
security/manager/ssl/tests/unit/test_ocsp_fetch_method/a.der
security/manager/ssl/tests/unit/test_ocsp_fetch_method/b.der
security/manager/ssl/tests/unit/test_ocsp_fetch_method/ca.der
security/manager/ssl/tests/unit/test_ocsp_fetch_method/cert9.db
security/manager/ssl/tests/unit/test_ocsp_fetch_method/generate.py
security/manager/ssl/tests/unit/test_ocsp_fetch_method/int.der
security/manager/ssl/tests/unit/test_ocsp_fetch_method/key4.db
security/manager/ssl/tests/unit/test_ocsp_fetch_method/pkcs11.txt
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d70e4bfdcb65e7514de0f9315b74aea1c811678d"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="d70e4bfdcb65e7514de0f9315b74aea1c811678d"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "68d369c2a2b0cd16db028f0c2e660107c52ce113", 
+        "git_revision": "0afa6429bf6a772289801600a84438cd7aa27b11", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "041d99d0bd97e84219626c711c4c709e9558dfaa", 
+    "revision": "6bf26f38e5c3092166347c2988f0f95be74333b3", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="0afa6429bf6a772289801600a84438cd7aa27b11"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>
--- a/browser/base/content/test/general/browser_audioTabIcon.js
+++ b/browser/base/content/test/general/browser_audioTabIcon.js
@@ -110,22 +110,38 @@ function* test_swapped_browser(oldTab, n
   ok(oldTab.hasAttribute("muted"), "Expected the correct muted attribute on the old tab");
   is(oldTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the old tab");
 
   let newTab = gBrowser.getTabForBrowser(newBrowser);
   let AttrChangePromise = BrowserTestUtils.waitForEvent(newTab, "TabAttrModified", false, event => {
     return (event.detail.changed.indexOf("soundplaying") >= 0 || !isPlaying) &&
            event.detail.changed.indexOf("muted") >= 0;
   });
+  let AudioPlaybackPromise = new Promise(resolve => {
+    let observer = (subject, topic, data) => {
+      ok(false, "Should not see an audio-playback notification");
+    };
+    Services.obs.addObserver(observer, "audio-playback", false);
+    setTimeout(() => {
+      Services.obs.removeObserver(observer, "audio-playback");
+      resolve();
+    }, 100);
+  });
 
   gBrowser.swapBrowsersAndCloseOther(newTab, oldTab);
   yield AttrChangePromise;
 
   ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
   is(newTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the new tab");
+
+  // Wait to see if an audio-playback event is dispatched.  This should not happen!
+  yield AudioPlaybackPromise;
+
+  ok(newTab.hasAttribute("muted"), "Expected the correct muted attribute on the new tab");
+  is(newTab.hasAttribute("soundplaying"), isPlaying, "Expected the correct soundplaying attribute on the new tab");
 }
 
 function* test_browser_swapping(tab, browser) {
   // First, test swapping with a playing but muted tab.
   yield ContentTask.spawn(browser, {}, function* () {
     let audio = content.document.querySelector("audio");
     audio.play();
   });
--- a/build/pgo/server-locations.txt
+++ b/build/pgo/server-locations.txt
@@ -166,16 +166,18 @@ https://sub.sectest1.example.org:443
 
 #
 # Used while testing the url-classifier
 #
 http://malware.example.com:80
 http://tracking.example.com:80
 http://not-tracking.example.com:80
 http://tracking.example.org:80
+http://itisatracker.org:80
+http://trackertest.org:80
 
 https://malware.example.com:443
 https://tracking.example.com:443
 https://not-tracking.example.com:443
 https://tracking.example.org:443
 
 # Bug 483437, 484111
 https://www.bank1.com:443           privileged,cert=escapeattack1
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -895,16 +895,17 @@ nsDocShell::nsDocShell()
   , mIsActive(true)
   , mIsPrerendered(false)
   , mIsAppTab(false)
   , mUseGlobalHistory(false)
   , mInPrivateBrowsing(false)
   , mUseRemoteTabs(false)
   , mDeviceSizeIsPageSize(false)
   , mWindowDraggingAllowed(false)
+  , mInFrameSwap(false)
   , mCanExecuteScripts(false)
   , mFiredUnloadEvent(false)
   , mEODForCurrentDocument(false)
   , mURIResultedInDocument(false)
   , mIsBeingDestroyed(false)
   , mIsExecutingOnLoadHandler(false)
   , mIsPrintingOrPP(false)
   , mSavingOldViewer(false)
@@ -14069,8 +14070,21 @@ nsDocShell::GetInheritedPaymentRequestId
 }
 
 NS_IMETHODIMP
 nsDocShell::GetPaymentRequestId(nsAString& aPaymentRequestId)
 {
   aPaymentRequestId = GetInheritedPaymentRequestId();
   return NS_OK;
 }
+
+bool
+nsDocShell::InFrameSwap()
+{
+  nsRefPtr<nsDocShell> shell = this;
+  do {
+    if (shell->mInFrameSwap) {
+      return true;
+    }
+    shell = shell->GetParentDocshell();
+  } while (shell);
+  return false;
+}
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -253,16 +253,22 @@ public:
 
   // Notify Scroll observers when an async panning/zooming transform
   // has started being applied
   void NotifyAsyncPanZoomStarted();
   // Notify Scroll observers when an async panning/zooming transform
   // is no longer applied
   void NotifyAsyncPanZoomStopped();
 
+  void SetInFrameSwap(bool aInSwap)
+  {
+    mInFrameSwap = aInSwap;
+  }
+  bool InFrameSwap();
+
 private:
   // An observed docshell wrapper is created when recording markers is enabled.
   mozilla::UniquePtr<mozilla::ObservedDocShell> mObserved;
   bool IsObserved() const { return !!mObserved; }
 
   // It is necessary to allow adding a timeline marker wherever a docshell
   // instance is available. This operation happens frequently and needs to
   // be very fast, so instead of using a Map or having to search for some
@@ -895,16 +901,17 @@ protected:
   bool mIsActive;
   bool mIsPrerendered;
   bool mIsAppTab;
   bool mUseGlobalHistory;
   bool mInPrivateBrowsing;
   bool mUseRemoteTabs;
   bool mDeviceSizeIsPageSize;
   bool mWindowDraggingAllowed;
+  bool mInFrameSwap;
 
   // Because scriptability depends on the mAllowJavascript values of our
   // ancestors, we cache the effective scriptability and recompute it when
   // it might have changed;
   bool mCanExecuteScripts;
   void RecomputeCanExecuteScripts();
 
   // This boolean is set to true right before we fire pagehide and generally
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -946,16 +946,70 @@ nsFrameLoader::SwapWithOtherRemoteLoader
 
   mInSwap = aOther->mInSwap = false;
 
   unused << mRemoteBrowser->SendSwappedWithOtherRemoteLoader();
   unused << aOther->mRemoteBrowser->SendSwappedWithOtherRemoteLoader();
   return NS_OK;
 }
 
+class MOZ_STACK_CLASS AutoResetInFrameSwap final
+{
+public:
+  AutoResetInFrameSwap(nsFrameLoader* aThisFrameLoader,
+                       nsFrameLoader* aOtherFrameLoader,
+                       nsDocShell* aThisDocShell,
+                       nsDocShell* aOtherDocShell,
+                       EventTarget* aThisEventTarget,
+                       EventTarget* aOtherEventTarget
+                       MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
+    : mThisFrameLoader(aThisFrameLoader)
+    , mOtherFrameLoader(aOtherFrameLoader)
+    , mThisDocShell(aThisDocShell)
+    , mOtherDocShell(aOtherDocShell)
+    , mThisEventTarget(aThisEventTarget)
+    , mOtherEventTarget(aOtherEventTarget)
+  {
+    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
+
+    mThisFrameLoader->mInSwap = true;
+    mOtherFrameLoader->mInSwap = true;
+    mThisDocShell->SetInFrameSwap(true);
+    mOtherDocShell->SetInFrameSwap(true);
+
+    // Fire pageshow events on still-loading pages, and then fire pagehide
+    // events.  Note that we do NOT fire these in the normal way, but just fire
+    // them on the chrome event handlers.
+    nsContentUtils::FirePageShowEvent(mThisDocShell, mThisEventTarget, false);
+    nsContentUtils::FirePageShowEvent(mOtherDocShell, mOtherEventTarget, false);
+    nsContentUtils::FirePageHideEvent(mThisDocShell, mThisEventTarget);
+    nsContentUtils::FirePageHideEvent(mOtherDocShell, mOtherEventTarget);
+  }
+
+  ~AutoResetInFrameSwap()
+  {
+    nsContentUtils::FirePageShowEvent(mThisDocShell, mThisEventTarget, true);
+    nsContentUtils::FirePageShowEvent(mOtherDocShell, mOtherEventTarget, true);
+
+    mThisFrameLoader->mInSwap = false;
+    mOtherFrameLoader->mInSwap = false;
+    mThisDocShell->SetInFrameSwap(false);
+    mOtherDocShell->SetInFrameSwap(false);
+  }
+
+private:
+  nsRefPtr<nsFrameLoader> mThisFrameLoader;
+  nsRefPtr<nsFrameLoader> mOtherFrameLoader;
+  nsRefPtr<nsDocShell> mThisDocShell;
+  nsRefPtr<nsDocShell> mOtherDocShell;
+  nsCOMPtr<EventTarget> mThisEventTarget;
+  nsCOMPtr<EventTarget> mOtherEventTarget;
+  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
+};
+
 nsresult
 nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
                                    nsRefPtr<nsFrameLoader>& aFirstToSwap,
                                    nsRefPtr<nsFrameLoader>& aSecondToSwap)
 {
   NS_PRECONDITION((aFirstToSwap == this && aSecondToSwap == aOther) ||
                   (aFirstToSwap == aOther && aSecondToSwap == this),
                   "Swapping some sort of random loaders?");
@@ -982,18 +1036,18 @@ nsFrameLoader::SwapWithOtherLoader(nsFra
   bool equal;
   nsresult rv =
     ourContent->NodePrincipal()->Equals(otherContent->NodePrincipal(), &equal);
   if (NS_FAILED(rv) || !equal) {
     // Security problems loom.  Just bail on it all
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
-  nsCOMPtr<nsIDocShell> ourDocshell = GetExistingDocShell();
-  nsCOMPtr<nsIDocShell> otherDocshell = aOther->GetExistingDocShell();
+  nsRefPtr<nsDocShell> ourDocshell = static_cast<nsDocShell*>(GetExistingDocShell());
+  nsRefPtr<nsDocShell> otherDocshell = static_cast<nsDocShell*>(aOther->GetExistingDocShell());
   if (!ourDocshell || !otherDocshell) {
     // How odd
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // To avoid having to mess with session history, avoid swapping
   // frameloaders that don't correspond to root same-type docshells,
   // unless both roots have session history disabled.
@@ -1114,49 +1168,33 @@ nsFrameLoader::SwapWithOtherLoader(nsFra
       otherDocshell->GetIsBrowserElement() ||
       ourDocshell->GetIsApp() != otherDocshell->GetIsApp()) {
       return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   if (mInSwap || aOther->mInSwap) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
-  mInSwap = aOther->mInSwap = true;
-
-  // Fire pageshow events on still-loading pages, and then fire pagehide
-  // events.  Note that we do NOT fire these in the normal way, but just fire
-  // them on the chrome event handlers.
-  nsContentUtils::FirePageShowEvent(ourDocshell, ourEventTarget, false);
-  nsContentUtils::FirePageShowEvent(otherDocshell, otherEventTarget, false);
-  nsContentUtils::FirePageHideEvent(ourDocshell, ourEventTarget);
-  nsContentUtils::FirePageHideEvent(otherDocshell, otherEventTarget);
-  
+  AutoResetInFrameSwap autoFrameSwap(this, aOther, ourDocshell, otherDocshell,
+                                     ourEventTarget, otherEventTarget);
+
   nsIFrame* ourFrame = ourContent->GetPrimaryFrame();
   nsIFrame* otherFrame = otherContent->GetPrimaryFrame();
   if (!ourFrame || !otherFrame) {
-    mInSwap = aOther->mInSwap = false;
-    nsContentUtils::FirePageShowEvent(ourDocshell, ourEventTarget, true);
-    nsContentUtils::FirePageShowEvent(otherDocshell, otherEventTarget, true);
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   nsSubDocumentFrame* ourFrameFrame = do_QueryFrame(ourFrame);
   if (!ourFrameFrame) {
-    mInSwap = aOther->mInSwap = false;
-    nsContentUtils::FirePageShowEvent(ourDocshell, ourEventTarget, true);
-    nsContentUtils::FirePageShowEvent(otherDocshell, otherEventTarget, true);
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // OK.  First begin to swap the docshells in the two nsIFrames
   rv = ourFrameFrame->BeginSwapDocShells(otherFrame);
   if (NS_FAILED(rv)) {
-    mInSwap = aOther->mInSwap = false;
-    nsContentUtils::FirePageShowEvent(ourDocshell, ourEventTarget, true);
-    nsContentUtils::FirePageShowEvent(otherDocshell, otherEventTarget, true);
     return rv;
   }
 
   // Now move the docshells to the right docshell trees.  Note that this
   // resets their treeowners to null.
   ourParentItem->RemoveChild(ourDocshell);
   otherParentItem->RemoveChild(otherDocshell);
   if (ourType == nsIDocShellTreeItem::typeContent) {
@@ -1249,20 +1287,16 @@ nsFrameLoader::SwapWithOtherLoader(nsFra
   // the wrong appUnitsPerDevPixel value. So we tell the PresShells that their
   // backing scale factor may have changed. (Bug 822266)
   ourShell->BackingScaleFactorChanged();
   otherShell->BackingScaleFactorChanged();
 
   ourParentDocument->FlushPendingNotifications(Flush_Layout);
   otherParentDocument->FlushPendingNotifications(Flush_Layout);
 
-  nsContentUtils::FirePageShowEvent(ourDocshell, ourEventTarget, true);
-  nsContentUtils::FirePageShowEvent(otherDocshell, otherEventTarget, true);
-
-  mInSwap = aOther->mInSwap = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsFrameLoader::Destroy()
 {
   StartDestroy();
   return NS_OK;
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -26,16 +26,17 @@
 #include "Units.h"
 #include "nsIWebBrowserPersistable.h"
 
 class nsIURI;
 class nsSubDocumentFrame;
 class nsView;
 class nsIInProcessContentFrameMessageManager;
 class AutoResetInShow;
+class AutoResetInFrameSwap;
 class nsITabParent;
 class nsIDocShellTreeItem;
 class nsIDocShellTreeOwner;
 class mozIApplication;
 
 namespace mozilla {
 namespace dom {
 class ContentParent;
@@ -54,16 +55,17 @@ typedef struct _GtkWidget GtkWidget;
 #endif
 
 class nsFrameLoader final : public nsIFrameLoader,
                             public nsIWebBrowserPersistable,
                             public nsStubMutationObserver,
                             public mozilla::dom::ipc::MessageManagerCallback
 {
   friend class AutoResetInShow;
+  friend class AutoResetInFrameSwap;
   typedef mozilla::dom::PBrowserParent PBrowserParent;
   typedef mozilla::dom::TabParent TabParent;
   typedef mozilla::layout::RenderFrameParent RenderFrameParent;
 
 public:
   static nsFrameLoader* Create(mozilla::dom::Element* aOwner,
                                bool aNetworkCreated);
 
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -98,16 +98,17 @@ static PRLogModuleInfo* gMediaElementEve
 
 #include "nsIContentSecurityPolicy.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/FloatingPoint.h"
 
 #include "nsIPermissionManager.h"
 #include "nsContentTypeParser.h"
+#include "nsDocShell.h"
 
 #include "mozilla/EventStateManager.h"
 
 #if defined(MOZ_B2G) && !defined(MOZ_GRAPHENE)
 // This controls the b2g specific of pausing the media element when the
 // AudioChannel tells us to mute it.
 #define PAUSE_MEDIA_ELEMENT_FROM_AUDIOCHANNEL
 #endif
@@ -4008,17 +4009,24 @@ bool HTMLMediaElement::IsBeingDestroyed(
 }
 
 void HTMLMediaElement::NotifyOwnerDocumentActivityChanged()
 {
   bool pauseElement = NotifyOwnerDocumentActivityChangedInternal();
   if (pauseElement && mAudioChannelAgent) {
     // If the element is being paused since we are navigating away from the
     // document, notify the audio channel agent.
-    NotifyAudioChannelAgent(false);
+    // Be careful to ignore this event during a docshell frame swap.
+    auto docShell = static_cast<nsDocShell*>(OwnerDoc()->GetDocShell());
+    if (!docShell) {
+      return;
+    }
+    if (!docShell->InFrameSwap()) {
+      NotifyAudioChannelAgent(false);
+    }
   }
 }
 
 bool
 HTMLMediaElement::NotifyOwnerDocumentActivityChangedInternal()
 {
   nsIDocument* ownerDoc = OwnerDoc();
   if (mDecoder && !IsBeingDestroyed()) {
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2387,21 +2387,28 @@ TabChild::RecvSwappedWithOtherRemoteLoad
     return true;
   }
 
   nsCOMPtr<nsPIDOMWindow> ourWindow = ourDocShell->GetWindow();
   if (NS_WARN_IF(!ourWindow)) {
     return true;
   }
 
+  nsRefPtr<nsDocShell> docShell = static_cast<nsDocShell*>(ourDocShell.get());
+
   nsCOMPtr<EventTarget> ourEventTarget = ourWindow->GetParentTarget();
 
+  docShell->SetInFrameSwap(true);
+
   nsContentUtils::FirePageShowEvent(ourDocShell, ourEventTarget, false);
   nsContentUtils::FirePageHideEvent(ourDocShell, ourEventTarget);
   nsContentUtils::FirePageShowEvent(ourDocShell, ourEventTarget, true);
+
+  docShell->SetInFrameSwap(false);
+
   return true;
 }
 
 bool
 TabChild::RecvDestroy()
 {
   MOZ_ASSERT(mDestroyed == false);
   mDestroyed = true;
--- a/gfx/gl/GLBlitHelper.cpp
+++ b/gfx/gl/GLBlitHelper.cpp
@@ -273,29 +273,29 @@ GLBlitHelper::InitTexQuadProgram(BlitTyp
 
     For [0,1] instead of [0,255], and to 5 places:
     [R] [1.16438, 0.00000, 1.59603] [ Y - 0.06275]
     [G] = [1.16438, -0.39176, -0.81297] x [Cb - 0.50196]
     [B] [1.16438, 2.01723, 0.00000] [Cr - 0.50196]
     */
     const char kTexYUVPlanarBlit_FragShaderSource[] = "\
         #ifdef GL_ES                                                        \n\
-        precision mediump float                                             \n\
+        precision mediump float;                                            \n\
         #endif                                                              \n\
         varying vec2 vTexCoord;                                             \n\
         uniform sampler2D uYTexture;                                        \n\
         uniform sampler2D uCbTexture;                                       \n\
         uniform sampler2D uCrTexture;                                       \n\
         uniform vec2 uYTexScale;                                            \n\
         uniform vec2 uCbCrTexScale;                                         \n\
         void main()                                                         \n\
         {                                                                   \n\
-            float y = texture2D(uYTexture, vTexCoord * uYTexScale).r;       \n\
-            float cb = texture2D(uCbTexture, vTexCoord * uCbCrTexScale).r;  \n\
-            float cr = texture2D(uCrTexture, vTexCoord * uCbCrTexScale).r;  \n\
+            float y = texture2D(uYTexture, vTexCoord * uYTexScale).a;       \n\
+            float cb = texture2D(uCbTexture, vTexCoord * uCbCrTexScale).a;  \n\
+            float cr = texture2D(uCrTexture, vTexCoord * uCbCrTexScale).a;  \n\
             y = (y - 0.06275) * 1.16438;                                    \n\
             cb = cb - 0.50196;                                              \n\
             cr = cr - 0.50196;                                              \n\
             gl_FragColor.r = y + cr * 1.59603;                              \n\
             gl_FragColor.g = y - 0.81297 * cr - 0.39176 * cb;               \n\
             gl_FragColor.b = y + cb * 2.01723;                              \n\
             gl_FragColor.a = 1.0;                                           \n\
         }                                                                   \n\
@@ -636,40 +636,40 @@ GLBlitHelper::BindAndUploadYUVTexture(Ch
                                       void* data,
                                       bool needsAllocation)
 {
     MOZ_ASSERT(which < Channel_Max, "Invalid channel!");
     GLuint* srcTexArr[3] = {&mSrcTexY, &mSrcTexCb, &mSrcTexCr};
     GLuint& tex = *srcTexArr[which];
     if (!tex) {
         MOZ_ASSERT(needsAllocation);
-        tex = CreateTexture(mGL, LOCAL_GL_LUMINANCE, LOCAL_GL_LUMINANCE, LOCAL_GL_UNSIGNED_BYTE,
+        tex = CreateTexture(mGL, LOCAL_GL_ALPHA, LOCAL_GL_ALPHA, LOCAL_GL_UNSIGNED_BYTE,
                             gfx::IntSize(width, height), false);
     }
     mGL->fActiveTexture(LOCAL_GL_TEXTURE0 + which);
 
     mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, tex);
     if (!needsAllocation) {
         mGL->fTexSubImage2D(LOCAL_GL_TEXTURE_2D,
                             0,
                             0,
                             0,
                             width,
                             height,
-                            LOCAL_GL_LUMINANCE,
+                            LOCAL_GL_ALPHA,
                             LOCAL_GL_UNSIGNED_BYTE,
                             data);
     } else {
         mGL->fTexImage2D(LOCAL_GL_TEXTURE_2D,
                          0,
-                         LOCAL_GL_LUMINANCE,
+                         LOCAL_GL_ALPHA,
                          width,
                          height,
                          0,
-                         LOCAL_GL_LUMINANCE,
+                         LOCAL_GL_ALPHA,
                          LOCAL_GL_UNSIGNED_BYTE,
                          data);
     }
 }
 
 void
 GLBlitHelper::BindAndUploadEGLImage(EGLImage image, GLuint target)
 {
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -448,30 +448,36 @@ LayerManagerComposite::RenderDebugOverla
       EffectChain effects;
       effects.mPrimaryEffect = new EffectSolidColor(gfx::Color(1, 0, 0, 1));
       mCompositor->DrawQuad(gfx::Rect(aBounds.width - 20, 0, aBounds.width, 20),
                             aBounds, effects, alpha, gfx::Matrix4x4());
 
       mUnusedApzTransformWarning = false;
       SetDebugOverlayWantsNextFrame(true);
     }
+
+    // Each frame is invalidate by the previous frame for simplicity
+    AddInvalidRegion(nsIntRect(0, 0, 256, 256));
   } else {
     mFPS = nullptr;
   }
 
   if (drawFrameColorBars) {
     gfx::Rect sideRect(0, 0, 10, aBounds.height);
 
     EffectChain effects;
     effects.mPrimaryEffect = new EffectSolidColor(gfxUtils::GetColorForFrameNumber(sFrameCount));
     mCompositor->DrawQuad(sideRect,
                           sideRect,
                           effects,
                           1.0,
                           gfx::Matrix4x4());
+
+    // Each frame is invalidate by the previous frame for simplicity
+    AddInvalidRegion(nsIntRect(0, 0, sideRect.width, sideRect.height));
   }
 
 #ifdef MOZ_PROFILING
   if (drawFrameCounter) {
     profiler_set_frame_number(sFrameCount);
     const char* qr = sQRCodeTable[sFrameCount%256];
 
     int size = 21;
@@ -504,16 +510,19 @@ LayerManagerComposite::RenderDebugOverla
                                           bitWidth, bitWidth),
                                 clip,
                                 effects,
                                 opacity,
                                 gfx::Matrix4x4());
         }
       }
     }
+
+    // Each frame is invalidate by the previous frame for simplicity
+    AddInvalidRegion(nsIntRect(0, 0, 256, 256));
   }
 #endif
 
   if (drawFrameColorBars || drawFrameCounter) {
     // We intentionally overflow at 2^16.
     sFrameCount++;
   }
 }
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -92,35 +92,38 @@ ifeq ($(MOZ_DEBUG),1)
 endif
 
 ifdef MOZ_VALGRIND
 ifndef MOZ_ASAN
 JITTEST_VALGRIND_FLAG = --valgrind
 endif
 endif
 
+ifneq ($(LLVM_SYMBOLIZER),)
+# Use the LLVM symbolizer when running jit-tests under ASan and TSan, if available
 ifdef MOZ_ASAN
-ifneq ($(LLVM_SYMBOLIZER),)
-# Use the LLVM symbolizer when running jit-tests under ASan, if available
-JITTEST_ASAN_ENV=ASAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)'
+JITTEST_SANITIZER_ENV=ASAN_SYMBOLIZER_PATH='$(LLVM_SYMBOLIZER)'
+endif
+ifdef MOZ_TSAN
+JITTEST_SANITIZER_ENV=TSAN_OPTIONS='external_symbolizer_path=$(LLVM_SYMBOLIZER)'
 endif
 endif
 
 check-style::
 	(cd $(srcdir) && $(PYTHON) $(topsrcdir)/config/check_spidermonkey_style.py);
 
 check-masm::
 	(cd $(srcdir) && $(PYTHON) $(topsrcdir)/config/check_macroassembler_style.py);
 
 check-jit-test::
-	$(JITTEST_ASAN_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
+	$(JITTEST_SANITIZER_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
 	        --no-slow --no-progress --format=automation --jitflags=all \
 			$(JITTEST_VALGRIND_FLAG) \
 			$(JITTEST_EXTRA_ARGS) \
-	        $(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
+	        $(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX) $(JITTEST_TEST_ARGS)
 
 check:: check-style check-masm
 
 check-jstests:
 	$(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/tests/jstests.py \
 		--no-progress --format=automation --timeout 300 \
 		$(JSTESTS_EXTRA_ARGS) \
 		$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -262,20 +262,19 @@ const JSPropertySpec MapObject::staticPr
     JS_PS_END
 };
 
 static JSObject*
 InitClass(JSContext* cx, Handle<GlobalObject*> global, const Class* clasp, JSProtoKey key, Native construct,
           const JSPropertySpec* properties, const JSFunctionSpec* methods,
           const JSPropertySpec* staticProperties)
 {
-    RootedNativeObject proto(cx, global->createBlankPrototype(cx, clasp));
+    RootedPlainObject proto(cx, NewBuiltinClassInstance<PlainObject>(cx));
     if (!proto)
         return nullptr;
-    proto->setPrivate(nullptr);
 
     Rooted<JSFunction*> ctor(cx, global->createConstructor(cx, construct, ClassName(key, cx), 0));
     if (!ctor ||
         !JS_DefineProperties(cx, ctor, staticProperties) ||
         !LinkConstructorAndPrototype(cx, ctor, proto) ||
         !DefinePropertiesAndFunctions(cx, proto, properties, methods) ||
         !GlobalObject::initBuiltinConstructor(cx, global, key, ctor, proto))
     {
--- a/js/src/jit-test/tests/collections/Map-surfaces-1.js
+++ b/js/src/jit-test/tests/collections/Map-surfaces-1.js
@@ -8,17 +8,21 @@ assertEq(desc.configurable, true);
 assertEq(desc.writable, true);
 
 assertEq(typeof Map, 'function');
 assertEq(Object.keys(Map).length, 0);
 assertEq(Map.length, 0);
 assertEq(Map.name, "Map");
 
 assertEq(Object.getPrototypeOf(Map.prototype), Object.prototype);
-assertEq(Object.prototype.toString.call(Map.prototype), "[object Map]");
+assertEq("toStringTag" in Symbol, false,
+         "if this fails, congratulations!  implement " +
+         "Map.prototype[Symbol.toStringTag] = 'Map' in SpiderMonkey and make " +
+         "the next test check for '[object Map]' again");
+assertEq(Object.prototype.toString.call(Map.prototype), "[object Object]");
 assertEq(Object.prototype.toString.call(new Map()), "[object Map]");
 assertEq(Object.keys(Map.prototype).join(), "");
 assertEq(Map.prototype.constructor, Map);
 
 function checkMethod(name, arity) { 
     var desc = Object.getOwnPropertyDescriptor(Map.prototype, name);
     assertEq(desc.enumerable, false);
     assertEq(desc.configurable, true);
--- a/js/src/jit-test/tests/collections/Set-surfaces-1.js
+++ b/js/src/jit-test/tests/collections/Set-surfaces-1.js
@@ -8,17 +8,21 @@ assertEq(desc.configurable, true);
 assertEq(desc.writable, true);
 
 assertEq(typeof Set, 'function');
 assertEq(Object.keys(Set).length, 0);
 assertEq(Set.length, 0);
 assertEq(Set.name, "Set");
 
 assertEq(Object.getPrototypeOf(Set.prototype), Object.prototype);
-assertEq(Object.prototype.toString.call(Set.prototype), "[object Set]");
+assertEq("toStringTag" in Symbol, false,
+         "if this fails, congratulations!  implement " +
+         "Set.prototype[Symbol.toStringTag] = 'Set' in SpiderMonkey and make " +
+         "the next test check for '[object Set]' again");
+assertEq(Object.prototype.toString.call(Set.prototype), "[object Object]");
 assertEq(Object.prototype.toString.call(new Set()), "[object Set]");
 assertEq(Object.keys(Set.prototype).join(), "");
 assertEq(Set.prototype.constructor, Set);
 
 function checkMethod(name, arity) { 
     var desc = Object.getOwnPropertyDescriptor(Set.prototype, name);
     assertEq(desc.enumerable, false);
     assertEq(desc.configurable, true);
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.cpp
@@ -185,21 +185,24 @@ MobileViewportManager::UpdateResolution(
 }
 
 void
 MobileViewportManager::UpdateSPCSPS(const ScreenIntSize& aDisplaySize,
                                     const CSSToScreenScale& aZoom)
 {
   ScreenSize compositionSize(aDisplaySize);
   ScreenMargin scrollbars =
-    CSSMargin::FromAppUnits(
+    LayoutDeviceMargin::FromAppUnits(
       nsLayoutUtils::ScrollbarAreaToExcludeFromCompositionBoundsFor(
-        mPresShell->GetRootScrollFrame()))
-    * CSSToScreenScale(1.0f); // Scrollbars are not subject to scaling, so
-                              // CSS pixels = layer pixels for them (modulo bug 1168487).
+        mPresShell->GetRootScrollFrame()),
+      mPresShell->GetPresContext()->AppUnitsPerDevPixel())
+    // Scrollbars are not subject to resolution scaling, so LD pixels =
+    // Screen pixels for them.
+    * LayoutDeviceToScreenScale(1.0f);
+
   compositionSize.width -= scrollbars.LeftRight();
   compositionSize.height -= scrollbars.TopBottom();
   CSSSize compSize = compositionSize / aZoom;
   MVM_LOG("%p: Setting SPCSPS %s\n", this, Stringify(compSize).c_str());
   nsLayoutUtils::SetScrollPositionClampingScrollPortSize(mPresShell, compSize);
 }
 
 void
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1072,16 +1072,20 @@ nsLayoutUtils::SetDisplayPortMargins(nsI
   MOZ_ASSERT(aContent->GetComposedDoc() == aPresShell->GetDocument());
 
   DisplayPortMarginsPropertyData* currentData =
     static_cast<DisplayPortMarginsPropertyData*>(aContent->GetProperty(nsGkAtoms::DisplayPortMargins));
   if (currentData && currentData->mPriority > aPriority) {
     return false;
   }
 
+  if (currentData && currentData->mMargins == aMargins) {
+    return true;
+  }
+
   aContent->SetProperty(nsGkAtoms::DisplayPortMargins,
                         new DisplayPortMarginsPropertyData(
                             aMargins, aPriority),
                         nsINode::DeleteProperty<DisplayPortMarginsPropertyData>);
 
   if (gfxPrefs::LayoutUseContainersForRootFrames()) {
     nsIFrame* rootScrollFrame = aPresShell->GetRootScrollFrame();
     if (rootScrollFrame &&
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2221,17 +2221,17 @@ void ScrollFrameHelper::MarkRecentlyScro
   } else {
     if (!gScrollFrameActivityTracker) {
       gScrollFrameActivityTracker = new ScrollFrameActivityTracker();
     }
     gScrollFrameActivityTracker->AddObject(this);
   }
 }
 
-void ScrollFrameHelper::ScrollVisual(nsPoint aOldScrolledFramePos)
+void ScrollFrameHelper::ScrollVisual()
 {
   // Mark this frame as having been scrolled. If this is the root
   // scroll frame of a content document, then IsAlwaysActive()
   // will return true from now on and MarkNotRecentlyScrolled() won't
   // have any effect.
   mHasBeenScrolled = true;
 
   AdjustViews(mScrolledFrame);
@@ -2240,17 +2240,16 @@ void ScrollFrameHelper::ScrollVisual(nsP
   bool needToInvalidateOnScroll = NeedToInvalidateOnScroll(mOuter);
   mOuter->RemoveStateBits(NS_SCROLLFRAME_INVALIDATE_CONTENTS_ON_SCROLL);
   if (needToInvalidateOnScroll) {
     MarkNotRecentlyScrolled();
   } else {
     MarkRecentlyScrolled();
   }
 
-  mOuter->SchedulePaint();
 }
 
 /**
  * Clamp desired scroll position aDesired and range [aDestLower, aDestUpper]
  * to [aBoundLower, aBoundUpper] and then select the appunit value from among
  * aBoundLower, aBoundUpper and those such that (aDesired - aCurrent) *
  * aRes/aAppUnitsPerPixel is an integer (or as close as we can get
  * modulo rounding to appunits) that is in [aDestLower, aDestUpper] and
@@ -2414,25 +2413,45 @@ ScrollFrameHelper::ScrollToImpl(nsPoint 
     presContext->PresShell()->ScheduleImageVisibilityUpdate();
   }
 
   // notify the listeners.
   for (uint32_t i = 0; i < mListeners.Length(); i++) {
     mListeners[i]->ScrollPositionWillChange(pt.x, pt.y);
   }
 
-  nsPoint oldScrollFramePos = mScrolledFrame->GetPosition();
+  nsRect oldDisplayPort;
+  nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &oldDisplayPort);
+  oldDisplayPort.MoveBy(-mScrolledFrame->GetPosition());
+
   // Update frame position for scrolling
   mScrolledFrame->SetPosition(mScrollPort.TopLeft() - pt);
   mLastScrollOrigin = aOrigin;
   mLastSmoothScrollOrigin = nullptr;
   mScrollGeneration = ++sScrollGenerationCounter;
 
-  // We pass in the amount to move visually
-  ScrollVisual(oldScrollFramePos);
+  ScrollVisual();
+
+  if (LastScrollOrigin() == nsGkAtoms::apz) {
+    // If this was an apz scroll and the displayport (relative to the
+    // scrolled frame) hasn't changed, then this won't trigger
+    // any painting, so no need to schedule one.
+    nsRect displayPort;
+    DebugOnly<bool> usingDisplayPort =
+      nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &displayPort);
+    NS_ASSERTION(usingDisplayPort, "Must have a displayport for apz scrolls!");
+
+    displayPort.MoveBy(-mScrolledFrame->GetPosition());
+
+    if (!displayPort.IsEqualEdges(oldDisplayPort)) {
+      mOuter->SchedulePaint();
+    }
+  } else {
+    mOuter->SchedulePaint();
+  }
 
   if (mOuter->ChildrenHavePerspective()) {
     // The overflow areas of descendants may depend on the scroll position,
     // so ensure they get updated.
     mOuter->RecomputePerspectiveChildrenOverflow(mOuter->StyleContext(), nullptr);
   }
 
   ScheduleSyntheticMouseMove();
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -217,17 +217,17 @@ public:
   void ScrollToCSSPixelsApproximate(const mozilla::CSSPoint& aScrollPosition,
                                     nsIAtom* aOrigin = nullptr);
 
   CSSIntPoint GetScrollPositionCSSPixels();
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   void ScrollToImpl(nsPoint aScrollPosition, const nsRect& aRange, nsIAtom* aOrigin = nullptr);
-  void ScrollVisual(nsPoint aOldScrolledFramePosition);
+  void ScrollVisual();
   /**
    * @note This method might destroy the frame, pres shell and other objects.
    */
   void ScrollBy(nsIntPoint aDelta, nsIScrollableFrame::ScrollUnit aUnit,
                 nsIScrollableFrame::ScrollMode aMode, nsIntPoint* aOverflow,
                 nsIAtom* aOrigin = nullptr,
                 nsIScrollableFrame::ScrollMomentum aMomentum = nsIScrollableFrame::NOT_MOMENTUM,
                 nsIScrollbarMediator::ScrollSnapMode aSnap
new file mode 100755
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/check-for-references.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+cd "$(dirname "$0")"
+find . -name reftest.list | sed 's,/reftest.list$,,' | while read DIRNAME
+do
+    cat "$DIRNAME/reftest.list" | grep -v "^\(include\|default-preferences\)" | sed 's/ #.*//;s/^#.*//;s/.* == /== /;s/.* != /!= /' | grep -v "^ *$" | while read TYPE TEST REF
+    do
+        REFTYPE=""
+        if [ "$TYPE" == "==" ]
+        then
+            REFTYPE="match"
+        elif [ "$TYPE" == "!=" ]
+        then
+            REFTYPE="mismatch"
+        else
+            echo "Unexpected type $TYPE for $DIRNAME/$TEST"
+        fi
+        if grep "rel=\"$REFTYPE\"" "$DIRNAME/$TEST" | head -1 | grep -q "href=\"$REF\""
+        then
+            #echo "Good link for $DIRNAME/$TEST"
+            echo -n
+        else
+            echo "Missing link for $DIRNAME/$TEST"
+            #echo "<link rel=\"$REFTYPE\" href=\"$REF\">" >> "$DIRNAME/$TEST"
+        fi
+    done
+done
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; page-break-before:always; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-10.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-10.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-11.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-11.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-12.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-12.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-13.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-13.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-8-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-14.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-14-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; height:1.5in; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-15.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-15-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; height:2.5in; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-2.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-2.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-3.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-3.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-4.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-4.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-5.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-5.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-6.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-6.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; overflow:hidden; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-7.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-7.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; overflow:hidden; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-8.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-8-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; overflow:hidden; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-9.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-block-page-break-inside-avoid-9.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; float:left; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-2.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-float-page-break-inside-avoid-2-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { float:left; page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-3.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-3.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { float:left; page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-4.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-4.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-block-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { float:left; page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-5.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-float-page-break-inside-avoid-5-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
         html,body {
             color:black; background-color:white; font-size:16px; padding:0; margin:0;
         }
 p { height: 0.5in; width: 1in; margin:0; background-color:blue; float:left; }
 .test { float:left; clear:left; page-break-inside:avoid; width:3.3in; }
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-6.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-float-page-break-inside-avoid-6-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 html,body {
     color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
 }
 p { height:60%; width:90%; margin:0; background-color:blue; border:1px solid black; }
 .test { page-break-inside:avoid; float:left; }
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-7.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-float-page-break-inside-avoid-7-ref.html">
   <meta name="flags" content="paged"><style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 html,body {
     color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
 }
 
 .test { 
   page-break-inside:avoid;
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-8.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-float-page-break-inside-avoid-8-ref.html">
   <meta name="flags" content="paged"><style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 html,body {
     color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
 }
 
 .test { 
   page-break-inside:avoid;
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-float-page-break-inside-avoid-9.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-float-page-break-inside-avoid-9-ref.html">
   <meta name="flags" content="paged"><style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 html,body {
     color:black; background-color:white; font-size:16px; padding:0; margin:0; height:100%;
 }
 
 .test { 
   page-break-inside:avoid;
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-inline-page-break-inside-avoid-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-inline-page-break-inside-avoid-1-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-5-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-2.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-row-page-break-inside-avoid-2.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-5-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-2.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-2.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-3.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-3.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-4.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-4-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-5.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-5-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-6.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-6.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-5-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 .bb { page-break-before:always; }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-7.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-7-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-rowgroup-page-break-inside-avoid-8.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-rowgroup-page-break-inside-avoid-8-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 .bb { page-break-before:always; }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-2.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-2-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-3.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-3-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 table { display:inline-table; }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-4.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-4-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 table { display:inline-table; }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-5.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-5-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 tr { page-break-before:always; }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-6.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-6-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-7.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-7-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-8.html
+++ b/layout/reftests/w3c-css/submitted/css21/pagination/moz-css21-table-page-break-inside-avoid-8.html
@@ -1,14 +1,15 @@
 <!DOCTYPE html>
 <html lang="en-US" class="reftest-print">
 <head>
   <title>CSS Test: CSS 2.1 page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-css21-table-page-break-inside-avoid-6-ref.html">
   <meta name="flags" content="paged">
 <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 p { height: 1in; width: 1in; margin:0; background-color:blue; }
 .test { page-break-inside:avoid; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/multicol3/moz-multicol3-column-balancing-break-inside-avoid-1.html
+++ b/layout/reftests/w3c-css/submitted/multicol3/moz-multicol3-column-balancing-break-inside-avoid-1.html
@@ -1,13 +1,14 @@
 <!DOCTYPE HTML>
 <html><head>
   <title>CSS Test: Balancing Overflow, page-break-inside:avoid</title>
   <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=685012">
   <link rel="help" href="http://www.w3.org/TR/CSS21/page.html#propdef-page-break-inside">
+  <link rel="match" href="moz-multicol3-column-balancing-break-inside-avoid-1-ref.html">
   <meta name="flags" content="paged">
   <meta charset="utf-8">
   <style type="text/css">
 @page { size:5in 3in; margin:0.5in; }
 
         html,body {
             color:black; background-color:white; font-size:16px; padding:0; margin:0;
         }
--- a/layout/reftests/w3c-css/submitted/test-template-001.xht
+++ b/layout/reftests/w3c-css/submitted/test-template-001.xht
@@ -2,17 +2,17 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: {{ brief but unique descriptive title of what's being tested }}</title>
   <link rel="author" title="{{ test author's name }}" href="{{ test author's contact info (mailto or http) }}" />
   <link rel="help" href="http://www.w3.org/TR/{{ URL to specific spec section; for multiple LINKs put primary first }}" />
   <meta name="flags" content="{{ see http://wiki.csswg.org/test/format#requirement-flags }}" />
   <meta name="assert" content="{{ explain precisely what is asserted when the test passes;
                                   optional but helps coordination and review }}" />
-  <link rel="match" href="test-template-001-ref.xht" />
+  <link rel="match" href="references/test-template-001.xht" />
   <style type="text/css"><![CDATA[
    {{ css for the test }}
   ]]></style>
  </head>
  <body>
    <!-- content of test -->
  </body>
 </html>
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-001.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-001.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Border-Box with specified width</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-border-box-001-ref.xht" />
   <meta name="assert" content="box-sizing: border-box should make the element's (percentage) width be the distance from the left border edge to the right border edge." />
   <style type="text/css"><![CDATA[
     .container {
       width: 300px;
       border: 2px solid black;
       position: absolute;
       left: 25px;
       top: 25px;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-002.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-002.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Border-Box with specified width</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-border-box-002-ref.xht" />
   <meta name="assert" content="box-sizing: border-box should make the element's (percentage) width be the distance from the left border edge to the right border edge." />
   <style type="text/css"><![CDATA[
     .container {
       width: 300px;
       border: 2px solid black;
       position: absolute;
       left: 25px;
       top: 25px;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-003.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-003.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Border-Box with specified width/height</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-border-box-003-ref.xht" />
   <meta name="assert" content="box-sizing: border-box should make the element's (percentage) width be the distance from the left border edge to the right border edge and the height be the distance from the top border edge to the bottom border edge." />
   <style type="text/css"><![CDATA[
     .container {
       width: 300px;
       height: 400px;
       border: 2px solid black;
       position: absolute;
       left: 25px;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-004.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-border-box-004.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Border-Box with min/max width/height</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-border-box-004-ref.xht" />
   <meta name="assert" content="box-sizing: border-box should make the element's (length) width be the distance from the left border edge to the right border edge and the height be the distance from the top border edge to the bottom border edge." />
   <style type="text/css"><![CDATA[
     .container {
       min-width: 500px;
       max-width: 700px;
       min-height: 70px;
       max-height: 90px;
       border: 2px solid black;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-content-box-001.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-content-box-001.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Content-Box with specified width/height</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-content-box-001-ref.xht" />
   <meta name="assert" content="box-sizing: content-box should make the element's (percentage) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge."/>
   <style type="text/css"><![CDATA[
     .container {
       width: 300px;
       height: 110px;
       border: 2px solid black;
       position: absolute;
       left: 25px;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-content-box-002.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-content-box-002.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Content-Box with specified width/height</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-content-box-002-ref.xht" />
   <meta name="assert" content="box-sizing: content-box should make the element's (calc) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge."/>
   <style type="text/css"><![CDATA[
     .container {
       width: 300px;
       height: 100px;
       border: 2px solid black;
       position: absolute;
       left: 25px;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-content-box-003.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-content-box-003.xht
@@ -1,14 +1,15 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
   <title>CSS Test: Box Sizing - Content-Box with min/max width/height</title>
   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" />
   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+  <link rel="match" href="box-sizing-content-box-003-ref.xht" />
   <meta name="assert" content="box-sizing: content-box should make the element's (percentage) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge."/>
   <style type="text/css"><![CDATA[
     .container {
       min-width: 500px;
       max-width: 700px;
       height: 90px;
       border: 2px solid black;
       position: absolute;
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-001.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-001.xht
@@ -1,15 +1,16 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
     <link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
     <link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
     <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+    <link rel="match" href="box-sizing-replaced-001-ref.xht" />
     <meta content="image" name="flags"></meta>
     <meta name="assert" content="All images should be sized at 75px x 75px, with 5px of padding around each." />
     <!--
       This test is derived from replaced-min-max-001, part of the W3C CSS 2.1
       test suite.
     -->
     <style type="text/css">
       p {
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-002.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-002.xht
@@ -1,15 +1,16 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
     <link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
     <link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
     <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+    <link rel="match" href="box-sizing-replaced-002-ref.xht" />
     <meta content="image" name="flags"></meta>
     <meta name="assert" content="All images should be sized at 75px x 75px, with 5px of padding and 5px of blue border around each." />
     <!--
       This test is derived from replaced-min-max-001, part of the W3C CSS 2.1
       test suite.
     -->
     <style type="text/css">
       p {
--- a/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-003.xht
+++ b/layout/reftests/w3c-css/submitted/ui3/box-sizing-replaced-003.xht
@@ -1,15 +1,16 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <title>CSS Test: Min/Max Height and Width Constraints on Replaced Elements with Box-Sizing</title>
     <link href="http://fantasai.inkedblade.net/contact" title="Elika J. Etemad" rel="author"></link>
     <link href="mailto:sjohnson@mozilla.com" title="Scott Johnson" rel="author"></link>
     <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing" />
+    <link rel="match" href="box-sizing-replaced-003-ref.xht" />
     <meta content="image" name="flags"></meta>
     <meta name="assert" content="All images should be sized at 75px x 75px." />
     <!--
       This test is derived from replaced-min-max-001, part of the W3C CSS 2.1
       test suite.
     -->
     <style type="text/css">
       p {
--- a/layout/reftests/w3c-css/submitted/values3/calc-background-image-gradient-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-background-image-gradient-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for calc() on background-image gradients</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-background-image-gradient-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 p {
     height: 50px; width: 200px;
     border: thin solid;
 }
 
--- a/layout/reftests/w3c-css/submitted/values3/calc-background-linear-gradient-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-background-linear-gradient-1.html
@@ -1,13 +1,14 @@
 <!DOCTYPE html>
 <head>
   <title>CSS Test: Support calc() on gradient stop positions</title>
   <link rel="author" title="Yu-Sian (Thomasy) Liu" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594935">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-background-linear-gradient-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 div {
  width:100px;
  height:100px;
  background:red;
  margin:5px 0 0 5px;
  float:left;
--- a/layout/reftests/w3c-css/submitted/values3/calc-background-position-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-background-position-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for calc() on background-position</title>
   <link rel="author" title="L. David Baron" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594934">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-background-position-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 p {
     height: 50px; width: 200px;
     border: thin solid;
     background-image: url(../backgrounds/blue-32x32.png);
     background-repeat: no-repeat;
--- a/layout/reftests/w3c-css/submitted/values3/calc-background-size-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-background-size-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for calc() on background-size</title>
   <link rel="author" title="L. David Baron" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594934">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-background-size-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 p {
     height: 50px; width: 200px;
     border: thin solid;
     background-image: url(../backgrounds/blue-32x32.png);
     background-repeat: no-repeat;
--- a/layout/reftests/w3c-css/submitted/values3/calc-border-radius-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-border-radius-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: test for border-radius: calc()</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-border-radius-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 p {
   /* We use powers of two here to avoid floating-point issues.
      See bug 590181. */
 
   height: 256px;
--- a/layout/reftests/w3c-css/submitted/values3/calc-height-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-height-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for height:calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-height-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; height: 100px; width: 1px; }
 body > div > div { background: blue }
 
 /* for auto-height tests */
 body > div > div > div > div { height: 10px }
--- a/layout/reftests/w3c-css/submitted/values3/calc-height-table-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-height-table-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test that height:calc() with no percentages has an effect on inner table elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-height-table-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 tbody, tr, td {
   height: calc(500px);
   min-height: calc(700px);
   max-height: calc(2px);
 }
 </style>
--- a/layout/reftests/w3c-css/submitted/values3/calc-margin-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-margin-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test of margin-*: calc()</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-margin-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 div { border: medium solid green; width: 500px }
 p { background: yellow }
 
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-max-height-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-max-height-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for max-height:calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-max-height-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; height: 100px; width: 1px; }
 body > div > div { background: blue }
 
 /* to give the max-height something to restrict */
 span { display: block; height: 300px }
--- a/layout/reftests/w3c-css/submitted/values3/calc-max-width-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-max-width-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: max-width: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-width-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { width: 500px }
 p { background: green; color: white; margin: 1px 0; font-size: 10px; width: 1000px; }
 
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-max-width-block-intrinsic-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-max-width-block-intrinsic-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: intrinsic width of max-width: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-max-width-block-intrinsic-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { font-size: 10px }
 body > div { float: left; clear: left;
              margin: 0 0 1px 0; background: blue; color: white; height: 5px }
 body > div > div { width: 400px }
 body > div > div > div { width: 200px }
--- a/layout/reftests/w3c-css/submitted/values3/calc-min-height-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-min-height-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for min-height:calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-height-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; height: 100px; width: 1px; }
 body > div > div { background: blue }
 
 /* for auto-height tests */
 body > div > div > div > div { height: 10px }
--- a/layout/reftests/w3c-css/submitted/values3/calc-min-width-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-min-width-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: min-width: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-width-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { width: 500px }
 p { background: green; color: white; margin: 1px 0; font-size: 10px; width: 0 }
 
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-min-width-block-intrinsic-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-min-width-block-intrinsic-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: intrinsic width of min-width: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-min-width-block-intrinsic-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { font-size: 10px }
 body > div { float: left; clear: left;
              margin: 0 0 1px 0; background: blue; color: white; height: 5px }
 body > div > div { width: 1px }
 body > div > div > div { width: 200px }
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-bottom-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-bottom-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for bottom:calc() on absolutely positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-absolute-top-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; margin-top: -90px; height: 100px; margin-bottom: 90px; width: 3px; position: relative }
 div[style] { background: blue; position: absolute; height: 10px; width: 3px }
 div.space { height: 100px }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-left-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-left-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for left:calc() on absolutely positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-relative-left-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 100px; width: 200px }
 body > div { height: 3px; position: relative }
 div[style] { background: blue; position: absolute; height: 3px; width: 100px }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-right-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-right-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for right:calc() on absolutely positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-relative-left-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0; width: 200px }
 body > div { height: 3px; position: relative }
 div[style] { background: blue; position: absolute; height: 3px; width: 100px }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-top-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-absolute-top-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for top:calc() on absolutely positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-absolute-top-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; height: 100px; width: 3px; position: relative }
 div[style] { background: blue; position: absolute; height: 10px; width: 3px }
 div.space { height: 100px }
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-bottom-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-bottom-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for bottom:calc() on relatively positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-relative-top-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; height: 100px; width: 3px; }
 div[style] { background: blue; position: relative; height: 10px; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-left-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-left-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for left:calc() on relatively positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-relative-left-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 100px; width: 100px }
 div[style] { background: blue; position: relative; height: 3px; }
 </style>
 </head>
 <body>
 
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-right-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-right-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for right:calc() on relatively positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-relative-left-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 100px; width: 100px }
 div[style] { background: blue; position: relative; height: 3px; }
 </style>
 </head>
 <body>
 
--- a/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-top-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-offsets-relative-top-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for top:calc() on relatively positioned elements</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-offsets-relative-top-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 body { margin: 0 }
 body > div { float: left; height: 100px; width: 3px; }
 div[style] { background: blue; position: relative; height: 10px; }
 </style>
 </head>
 <body>
--- a/layout/reftests/w3c-css/submitted/values3/calc-padding-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-padding-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test of padding-*: calc()</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-padding-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { width: 500px }
 div { border: medium solid green }
 p { background: yellow; margin: 0 }
 
 </style>
--- a/layout/reftests/w3c-css/submitted/values3/calc-text-indent-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-text-indent-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: text-indent: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-text-indent-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { width: 500px }
 p { font-size: 10px }
 
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-text-indent-intrinsic-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-text-indent-intrinsic-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: intrinsic width of text-indent: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-text-indent-intrinsic-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { font-size: 10px }
 div { float: left; clear: left;
        margin: 0 0 1px 0; background: blue; color: white; height: 5px }
 span { display: inline-block; width: 10px }
 
--- a/layout/reftests/w3c-css/submitted/values3/calc-transform-origin-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-transform-origin-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for calc() on transform-origin</title>
   <link rel="author" title="L. David Baron" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594934">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-transform-origin-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { margin: 100px }
 
 p {
     height: 50px; width: 200px;
     background: yellow;
--- a/layout/reftests/w3c-css/submitted/values3/calc-vertical-align-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-vertical-align-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: Test for vertical-align:calc()</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-vertical-align-1-ref.html">
   <meta name="flags" content="">
 
 <div style="line-height: 100px; margin-top: 100px">
   <span>x</span>
   <span style="vertical-align: calc(50px)">x</span>
   <span style="vertical-align: calc(50%)">x</span>
   <span style="vertical-align: calc(25px + 50%)">x</span>
   <span style="vertical-align: calc(150% / 2 - 30px)">x</span>
--- a/layout/reftests/w3c-css/submitted/values3/calc-width-block-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-width-block-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: width: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-width-block-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { width: 500px }
 p { background: green; color: white; margin: 1px 0; font-size: 10px }
 
 </style>
 </head>
--- a/layout/reftests/w3c-css/submitted/values3/calc-width-block-intrinsic-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-width-block-intrinsic-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: intrinsic width of width: calc() on blocks</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-width-block-intrinsic-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 
 body { font-size: 10px }
 body > div { float: left; clear: left;
              margin: 0 0 1px 0; background: blue; color: white; height: 5px }
 body > div > div > div { width: 200px }
 
--- a/layout/reftests/w3c-css/submitted/values3/calc-width-table-auto-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-width-table-auto-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: width: calc() on table-layout: auto tables</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-width-table-auto-1-ref.html">
   <meta name="flags" content="">
 <table border>
   <tr>
     <td style="width: calc(500px)">x</td>
     <td style="width: 100px">y</td>
 </table>
 <table border>
   <tr>
--- a/layout/reftests/w3c-css/submitted/values3/calc-width-table-fixed-1.html
+++ b/layout/reftests/w3c-css/submitted/values3/calc-width-table-fixed-1.html
@@ -1,14 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head>
   <title>CSS Test: width: calc() on table-layout: auto tables</title>
   <link rel="author" title="L. David Baron" href="http://dbaron.org/">
   <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation">
+  <link rel="match" href="calc-width-table-fixed-1-ref.html">
   <meta name="flags" content="">
 <style type="text/css">
 table { table-layout: fixed; width: 500px; border-spacing: 0 }
 </style>
 </head>
 <body>
 <table border>
   <tr>
--- a/layout/reftests/w3c-css/submitted/variables/variable-external-font-face-01.html
+++ b/layout/reftests/w3c-css/submitted/variables/variable-external-font-face-01.html
@@ -1,13 +1,13 @@
 <!--
      Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <!DOCTYPE html>
 <title>CSS Test: Test the invalid declaration and use of a variable in an @font-face rule within an external CSS.</title>
 <link rel="author" title="Mihaela Velimiroviciu" href="mailto:mihaela.velimiroviciu@softvisioninc.eu">
 <link rel="help" href="http://www.w3.org/TR/css-variables-1/#defining-variables">
-<link rel="match" href="variable-font-face-01-ref.html">
+<link rel="match" href="variable-external-font-face-01-ref.html">
 <link rel="stylesheet" type="text/css" href="support/external-variable-font-face.css">
 <meta name="flags" content="ahem">
 <p id=a>This text must not be in Ahem.</p>
 <p id=b>But this text must be in Ahem.</p>
--- a/layout/reftests/w3c-css/submitted/variables/variable-reference-38.html
+++ b/layout/reftests/w3c-css/submitted/variables/variable-reference-38.html
@@ -1,16 +1,16 @@
 <!--
      Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <!DOCTYPE html>
 <title>CSS Test: Test using variables in overlapping shorthands.</title>
 <link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
 <link rel="help" href="http://www.w3.org/TR/css-variables-1/#variables-in-shorthands">
-<link rel="match" href="variable-declaration-59-ref.html">
+<link rel="match" href="variable-reference-38-ref.html">
 <style>
 p { padding-left: 1em; }
 #a { --style: solid; --left: black dotted; border-style: var(--style); border-left: var(--left); border-top: none; border-right: none; border-bottom: none; }
 #b { --style: solid; --left: black dotted; border-left: var(--left); border-style: var(--style); border-top: none; border-right: none; border-bottom: none; }
 </style>
 <p id=a>The left border must be dotted.</p>
 <p id=b>The left border must be solid.</p>
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -735,17 +735,20 @@ nsSliderFrame::CurrentPositionChanged()
   } else {
     newThumbRect.y = snappedThumbLocation.y;
   }
 
   // set the rect
   thumbFrame->SetRect(newThumbRect);
 
   // Request a repaint of the scrollbar
-  SchedulePaint();
+  nsIScrollableFrame* scrollableFrame = do_QueryFrame(GetScrollbar()->GetParent());
+  if (!scrollableFrame || scrollableFrame->LastScrollOrigin() != nsGkAtoms::apz) {
+    SchedulePaint();
+  }
 
   mCurPos = curPos;
 
   // inform the parent <scale> if it exists that the value changed
   nsIFrame* parent = GetParent();
   if (parent) {
     nsCOMPtr<nsISliderListener> sliderListener = do_QueryInterface(parent->GetContent());
     if (sliderListener) {
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4776,21 +4776,22 @@ pref("dom.inter-app-communication-api.en
 // Disable mapped array buffer by default.
 pref("dom.mapped_arraybuffer.enabled", false);
 
 // The tables used for Safebrowsing phishing and malware checks.
 pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,test-malware-simple,test-unwanted-simple");
 pref("urlclassifier.phishTable", "goog-phish-shavar,test-phish-simple");
 pref("urlclassifier.downloadBlockTable", "");
 pref("urlclassifier.downloadAllowTable", "");
-pref("urlclassifier.disallow_completions", "test-malware-simple,test-phish-simple,test-unwanted-simple,test-track-simple,goog-downloadwhite-digest256,mozpub-track-digest256");
+pref("urlclassifier.disallow_completions", "test-malware-simple,test-phish-simple,test-unwanted-simple,test-track-simple,test-trackwhite-simple,goog-downloadwhite-digest256,mozpub-track-digest256,mozpub-trackwhite-digest256");
 
 // The table and update/gethash URLs for Safebrowsing phishing and malware
 // checks.
 pref("urlclassifier.trackingTable", "test-track-simple,mozpub-track-digest256");
+pref("urlclassifier.trackingWhitelistTable", "test-trackwhite-simple,mozpub-trackwhite-digest256");
 pref("browser.trackingprotection.updateURL", "https://tracking.services.mozilla.com/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
 pref("browser.trackingprotection.gethashURL", "https://tracking.services.mozilla.com/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
 
 // Turn off Spatial navigation by default.
 pref("snav.enabled", false);
 
 // Original caret implementation on collapsed selection.
 pref("touchcaret.enabled", false);
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -507,22 +507,93 @@ nsChannelClassifier::SetBlockedTrackingC
                                   doc,
                                   nsContentUtils::eNECKO_PROPERTIES,
                                   "TrackingUriBlocked",
                                   params, ArrayLength(params));
 
   return NS_OK;
 }
 
+nsresult
+nsChannelClassifier::IsTrackerWhitelisted()
+{
+  nsresult rv;
+  nsCOMPtr<nsIURIClassifier> uriClassifier =
+    do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsAutoCString tables;
+  Preferences::GetCString("urlclassifier.trackingWhitelistTable", &tables);
+
+  if (tables.IsEmpty()) {
+    LOG(("nsChannelClassifier[%p]:IsTrackerWhitelisted whitelist disabled",
+         this));
+    return NS_ERROR_TRACKING_URI;
+  }
+
+  nsCOMPtr<nsIHttpChannelInternal> chan = do_QueryInterface(mChannel, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsCOMPtr<nsIURI> topWinURI;
+  rv = chan->GetTopWindowURI(getter_AddRefs(topWinURI));
+  NS_ENSURE_SUCCESS(rv, rv);
+  if (!topWinURI) {
+    LOG(("nsChannelClassifier[%p]: No window URI", this));
+    return NS_ERROR_TRACKING_URI;
+  }
+
+  nsCOMPtr<nsIScriptSecurityManager> securityManager =
+    do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
+  NS_ENSURE_SUCCESS(rv, rv);
+  nsCOMPtr<nsIPrincipal> chanPrincipal;
+  rv = securityManager->GetChannelURIPrincipal(mChannel,
+                                               getter_AddRefs(chanPrincipal));
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Craft a whitelist URL like "toplevel.page/?resource=third.party.domain"
+  nsAutoCString pageHostname, resourceDomain;
+  rv = topWinURI->GetHost(pageHostname);
+  NS_ENSURE_SUCCESS(rv, rv);
+  rv = chanPrincipal->GetBaseDomain(resourceDomain);
+  NS_ENSURE_SUCCESS(rv, rv);
+  nsAutoCString whitelistEntry = NS_LITERAL_CSTRING("http://") +
+    pageHostname + NS_LITERAL_CSTRING("/?resource=") + resourceDomain;
+  LOG(("nsChannelClassifier[%p]: Looking for %s in the whitelist",
+       this, whitelistEntry.get()));
+
+  nsCOMPtr<nsIURI> whitelistURI;
+  rv = NS_NewURI(getter_AddRefs(whitelistURI), whitelistEntry);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Check whether or not the tracker is in the entity whitelist
+  nsAutoCString results;
+  rv = uriClassifier->ClassifyLocalWithTables(whitelistURI, tables, results);
+  NS_ENSURE_SUCCESS(rv, rv);
+  if (!results.IsEmpty()) {
+    return NS_OK; // found it on the whitelist, must not be blocked
+  }
+
+  LOG(("nsChannelClassifier[%p]: %s is not in the whitelist",
+       this, whitelistEntry.get()));
+  return NS_ERROR_TRACKING_URI;
+}
+
 NS_IMETHODIMP
 nsChannelClassifier::OnClassifyComplete(nsresult aErrorCode)
 {
     // Should only be called in the parent process.
     MOZ_ASSERT(XRE_IsParentProcess());
 
+    if (aErrorCode == NS_ERROR_TRACKING_URI &&
+        NS_SUCCEEDED(IsTrackerWhitelisted())) {
+      LOG(("nsChannelClassifier[%p]:OnClassifyComplete tracker found "
+           "in whitelist so we won't block it)", this));
+      aErrorCode = NS_OK;
+    }
+
     LOG(("nsChannelClassifier[%p]:OnClassifyComplete %d", this, aErrorCode));
     if (mSuspendedChannel) {
         MarkEntryClassified(aErrorCode);
 
         if (NS_FAILED(aErrorCode)) {
 #ifdef DEBUG
             nsCOMPtr<nsIURI> uri;
             mChannel->GetURI(getter_AddRefs(uri));
--- a/netwerk/base/nsChannelClassifier.h
+++ b/netwerk/base/nsChannelClassifier.h
@@ -36,16 +36,18 @@ private:
     ~nsChannelClassifier() {}
     // Caches good classifications for the channel principal.
     void MarkEntryClassified(nsresult status);
     bool HasBeenClassified(nsIChannel *aChannel);
     // Helper function so that we ensure we call ContinueBeginConnect once
     // Start is called. Returns NS_OK if and only if we will get a callback
     // from the classifier service.
     nsresult StartInternal();
+    // Helper function to check a tracking URI against the whitelist
+    nsresult IsTrackerWhitelisted();
 
 public:
     // If we are blocking tracking content, update the corresponding flag in
     // the respective docshell and call nsISecurityEventSink::onSecurityChange.
     static nsresult SetBlockedTrackingContent(nsIChannel *channel);
     static nsresult NotifyTrackingProtectionDisabled(nsIChannel *aChannel);
 };
 
--- a/netwerk/base/nsIURIClassifier.idl
+++ b/netwerk/base/nsIURIClassifier.idl
@@ -1,16 +1,17 @@
 /* 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/. */
 
 #include "nsISupports.idl"
 
+interface nsIChannel;
 interface nsIPrincipal;
-interface nsIChannel;
+interface nsIURI;
 
 /**
  * Callback function for nsIURIClassifier lookups.
  */
 [scriptable, function, uuid(8face46e-0c96-470f-af40-0037dcd797bd)]
 interface nsIURIClassifierCallback : nsISupports
 {
   /**
@@ -25,17 +26,17 @@ interface nsIURIClassifierCallback : nsI
    */
   void onClassifyComplete(in nsresult aErrorCode);
 };
 
 /**
  * The URI classifier service checks a URI against lists of phishing
  * and malware sites.
  */
-[scriptable, uuid(9168a330-7fba-40e8-9c47-4ce8f15a57fd)]
+[scriptable, uuid(596620cc-76e3-4133-9d90-360e59a794cf)]
 interface nsIURIClassifier : nsISupports
 {
   /**
    * Classify a Principal using its URI.
    *
    * @param aPrincipal
    *        The principal that should be checked by the URI classifier.
    * @param aTrackingProtectionEnabled
@@ -51,15 +52,14 @@ interface nsIURIClassifier : nsISupports
    *         <code>true</code> if classification will be performed.  The
    *         callback will be called.
    */
   boolean classify(in nsIPrincipal aPrincipal,
                    in boolean aTrackingProtectionEnabled,
                    in nsIURIClassifierCallback aCallback);
 
   /**
-   * Synchronously classify a Principal locally using its URI with a
-   * comma-separated string containing the given tables. This does not make
-   * network requests. The result is a comma-separated string of tables that match.
+   * Synchronously classify a URI with a comma-separated string
+   * containing the given tables. This does not make network requests.
+   * The result is a comma-separated string of tables that match.
    */
-  ACString classifyLocalWithTables(in nsIPrincipal aPrincipal,
-                                   in ACString aTables);
+  ACString classifyLocalWithTables(in nsIURI aURI, in ACString aTables);
 };
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5155,33 +5155,34 @@ nsHttpChannel::BeginConnect()
     // nsIHttpChannel.redirectTo API request
     if (mAPIRedirectToURI) {
         return AsyncCall(&nsHttpChannel::HandleAsyncAPIRedirect);
     }
     // Check to see if this principal exists on local blocklists.
     nsRefPtr<nsChannelClassifier> channelClassifier = new nsChannelClassifier();
     if (mLoadFlags & LOAD_CLASSIFY_URI) {
         nsCOMPtr<nsIURIClassifier> classifier = do_GetService(NS_URICLASSIFIERSERVICE_CONTRACTID);
-        if (classifier) {
-            bool tpEnabled = false;
-            channelClassifier->ShouldEnableTrackingProtection(this, &tpEnabled);
+        bool tpEnabled = false;
+        channelClassifier->ShouldEnableTrackingProtection(this, &tpEnabled);
+        if (classifier && tpEnabled) {
             // We skip speculative connections by setting mLocalBlocklist only
             // when tracking protection is enabled. Though we could do this for
             // both phishing and malware, it is not necessary for correctness,
             // since no network events will be received while the
             // nsChannelClassifier is in progress. See bug 1122691.
-            if (tpEnabled) {
-                nsCOMPtr<nsIPrincipal> principal = GetURIPrincipal();
+            nsCOMPtr<nsIURI> uri;
+            rv = GetURI(getter_AddRefs(uri));
+            if (NS_SUCCEEDED(rv) && uri) {
                 nsAutoCString tables;
                 Preferences::GetCString("urlclassifier.trackingTable", &tables);
                 nsAutoCString results;
-                rv = classifier->ClassifyLocalWithTables(principal, tables, results);
+                rv = classifier->ClassifyLocalWithTables(uri, tables, results);
                 if (NS_SUCCEEDED(rv) && !results.IsEmpty()) {
                     LOG(("nsHttpChannel::ClassifyLocalWithTables found "
-                         "principal on local tracking blocklist [this=%p]",
+                         "uri on local tracking blocklist [this=%p]",
                          this));
                     mLocalBlocklist = true;
                 } else {
                     LOG(("nsHttpChannel::ClassifyLocalWithTables no result "
                          "found [this=%p]", this));
                 }
             }
         }
--- a/security/manager/ssl/tests/unit/moz.build
+++ b/security/manager/ssl/tests/unit/moz.build
@@ -10,14 +10,15 @@ TEST_DIRS += [
     'test_cert_embedded_null',
     'test_cert_keyUsage',
     'test_cert_trust',
     'test_cert_version',
     'test_ev_certs',
     'test_intermediate_basic_usage_constraints',
     'test_keysize_ev',
     'test_pinning_dynamic',
+    'test_ocsp_fetch_method',
     'test_ocsp_url',
     'test_validity',
 ]
 
 if not CONFIG['MOZ_NO_SMART_CARDS']:
     DIRS += ['pkcs11testmodule']
--- a/security/manager/ssl/tests/unit/test_ocsp_fetch_method.js
+++ b/security/manager/ssl/tests/unit/test_ocsp_fetch_method.js
@@ -18,24 +18,24 @@ const SERVER_PORT = 8888;
 function start_ocsp_responder(expectedCertNames, expectedPaths,
                               expectedMethods) {
   return startOCSPResponder(SERVER_PORT, "www.example.com", [],
                             "test_ocsp_fetch_method", expectedCertNames,
                             expectedPaths, expectedMethods);
 }
 
 function check_cert_err(cert_name, expected_error) {
-  let cert = constructCertFromFile("test_ocsp_fetch_method/" + cert_name + ".der");
+  let cert = constructCertFromFile("test_ocsp_fetch_method/" + cert_name + ".pem");
   return checkCertErrorGeneric(certdb, cert, expected_error,
                                certificateUsageSSLServer);
 }
 
 function run_test() {
-  addCertFromFile(certdb, "test_ocsp_fetch_method/ca.der", 'CTu,CTu,CTu');
-  addCertFromFile(certdb, "test_ocsp_fetch_method/int.der", ',,');
+  addCertFromFile(certdb, "test_ocsp_fetch_method/ca.pem", 'CTu,CTu,CTu');
+  addCertFromFile(certdb, "test_ocsp_fetch_method/int.pem", ',,');
 
   // Enabled so that we can force ocsp failure responses.
   Services.prefs.setBoolPref("security.OCSP.require", true);
 
   Services.prefs.setCharPref("network.dns.localDomains",
                              "www.example.com");
   Services.prefs.setIntPref("security.OCSP.enabled", 1);
 
@@ -50,21 +50,10 @@ function run_test() {
   add_test(function() {
     clearOCSPCache();
     Services.prefs.setBoolPref("security.OCSP.GET.enabled", true);
     let ocspResponder = start_ocsp_responder(["a"], [], ["GET"]);
     check_cert_err("a", PRErrorCodeSuccess);
     ocspResponder.stop(run_next_test);
   });
 
-  // GET does fallback on bad entry
-  add_test(function() {
-    clearOCSPCache();
-    Services.prefs.setBoolPref("security.OCSP.GET.enabled", true);
-    // Bug 1016681 mozilla::pkix does not support fallback yet.
-    // let ocspResponder = start_ocsp_responder(["b", "a"], [], ["GET", "POST"]);
-    // check_cert_err("a", PRErrorCodeSuccess);
-    // ocspResponder.stop(run_next_test);
-    run_next_test();
-  });
-
   run_next_test();
 }
deleted file mode 100644
index 48b71256a6befd2675b22410362d6bc5d6160464..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/tests/unit/test_ocsp_fetch_method/a.pem.certspec
@@ -0,0 +1,3 @@
+issuer:int
+subject:a
+extension:authorityInformationAccess:http://www.example.com:8888/
deleted file mode 100644
index b7a751f540da98e11903956f1413ed14611a5701..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 20e8db54b0893a46b85356ab5c59bdd83cdd4e9f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/tests/unit/test_ocsp_fetch_method/ca.pem.certspec
@@ -0,0 +1,4 @@
+issuer:ca
+subject:ca
+extension:basicConstraints:cA,
+extension:keyUsage:cRLSign,keyCertSign
deleted file mode 100644
index e54db78087a5091c79ff2756a5bbabbbb2577001..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
--- a/security/manager/ssl/tests/unit/test_ocsp_fetch_method/generate.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-
-import tempfile, os, sys
-
-libpath = os.path.abspath('../psm_common_py')
-sys.path.append(libpath)
-import CertUtils
-
-srcdir = os.getcwd()
-db = tempfile.mkdtemp()
-
-def generate_ca_cert(db_dir, dest_dir, noise_file, name):
-    return CertUtils.generate_ca_cert(db_dir, dest_dir, noise_file, name,
-                                      3, True)
-
-def generate_child_cert(db_dir, dest_dir, noise_file, name, ca_nick, is_ee,
-                        ocsp_url):
-    return CertUtils.generate_child_cert(db_dir, dest_dir, noise_file, name,
-                                         ca_nick, 3, True, is_ee, ocsp_url)
-
-def generate_certs():
-    [noise_file, pwd_file] = CertUtils.init_nss_db(srcdir)
-    generate_ca_cert(srcdir, srcdir, noise_file, 'ca')
-    generate_child_cert(srcdir, srcdir, noise_file, 'int', 'ca', False, '')
-    ocsp_url = "http://www.example.com:8888/"
-    generate_child_cert(srcdir, srcdir, noise_file, "a", 'int', True, ocsp_url)
-    generate_child_cert(srcdir, srcdir, noise_file, "b", 'int', True, ocsp_url)
-
-generate_certs()
deleted file mode 100644
index 661e814efaa9f67bc37bcef536b7f358ee34a666..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/tests/unit/test_ocsp_fetch_method/int.pem.certspec
@@ -0,0 +1,4 @@
+issuer:ca
+subject:int
+extension:basicConstraints:cA,
+extension:keyUsage:cRLSign,keyCertSign
deleted file mode 100644
index ada3335ecf24660ab3a4e0979a133ed8df901389..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
--- /dev/null
+++ b/security/manager/ssl/tests/unit/test_ocsp_fetch_method/moz.build
@@ -0,0 +1,31 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+test_certificates = (
+    'a.pem',
+    'ca.pem',
+    'int.pem',
+)
+
+for test_certificate in test_certificates:
+    input_file = test_certificate + '.certspec'
+    GENERATED_FILES += [test_certificate]
+    props = GENERATED_FILES[test_certificate]
+    props.script = '../pycert.py'
+    props.inputs = [input_file]
+    TEST_HARNESS_FILES.xpcshell.security.manager.ssl.tests.unit.test_ocsp_fetch_method += ['!%s' % test_certificate]
+
+test_keys = (
+    'int.key',
+)
+
+for test_key in test_keys:
+    input_file = test_key + '.keyspec'
+    GENERATED_FILES += [test_key]
+    props = GENERATED_FILES[test_key]
+    props.script = '../pykey.py'
+    props.inputs = [input_file]
+    TEST_HARNESS_FILES.xpcshell.security.manager.ssl.tests.unit.test_ocsp_fetch_method += ['!%s' % test_key]
deleted file mode 100644
--- a/security/manager/ssl/tests/unit/test_ocsp_fetch_method/pkcs11.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-library=
-name=NSS Internal PKCS #11 Module
-parameters=configdir='sql:/home/cviecco/hg/mozilla-central-unified/security/manager/ssl/tests/unit/test_ocsp_fetch_method' certPrefix='' keyPrefix='' secmod='secmod.db' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription='' 
-NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30})
-
--- a/security/nss/TAG-INFO
+++ b/security/nss/TAG-INFO
@@ -1,1 +1,1 @@
-NSS_3_19_3_RC0
+NSS_3_19_3_RTM
--- a/security/nss/coreconf/coreconf.dep
+++ b/security/nss/coreconf/coreconf.dep
@@ -5,9 +5,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSS in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/testing/marionette/client/marionette/tests/unit/unit-tests.ini
+++ b/testing/marionette/client/marionette/tests/unit/unit-tests.ini
@@ -142,17 +142,16 @@ browser = false
 b2g = false
 [test_set_window_size.py]
 b2g = false
 skip-if = os == "linux" # Bug 1085717
 [test_with_using_context.py]
 
 [test_modal_dialogs.py]
 b2g = false
-skip-if = true # Disabled so bug 959567 can land
 [test_key_actions.py]
 [test_mouse_action.py]
 b2g = false
 [test_teardown_context_preserved.py]
 b2g = false
 [test_file_upload.py]
 b2g = false
 skip-if = os == "win" # http://bugs.python.org/issue14574
--- a/testing/marionette/driver/marionette_driver/geckoinstance.py
+++ b/testing/marionette/driver/marionette_driver/geckoinstance.py
@@ -22,16 +22,17 @@ class GeckoInstance(object):
                       "browser.displayedE10SPrompt.2": 5,
                       "browser.displayedE10SPrompt.3": 5,
                       "browser.displayedE10SPrompt.4": 5,
                       "browser.sessionstore.resume_from_crash": False,
                       "browser.shell.checkDefaultBrowser": False,
                       "browser.startup.page": 0,
                       "browser.tabs.remote.autostart.1": False,
                       "browser.tabs.remote.autostart.2": False,
+                      "browser.urlbar.userMadeSearchSuggestionsChoice": True,
                       "browser.warnOnQuit": False,
                       "dom.ipc.reportProcessHangs": False,
                       "focusmanager.testmode": True,
                       "startup.homepage_welcome_url": "about:blank"}
 
     def __init__(self, host, port, bin, profile=None, addons=None,
                  app_args=None, symbols_path=None, gecko_log=None, prefs=None):
         self.marionette_host = host
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -1123,24 +1123,17 @@ class AndroidArguments(ArgumentContainer
 container_map = {
     'generic': [MochitestArguments],
     'b2g': [MochitestArguments, B2GArguments],
     'android': [MochitestArguments, AndroidArguments],
 }
 
 
 class MochitestArgumentParser(ArgumentParser):
-    """
-    Usage instructions for Mochitest.
-
-    All arguments are optional.
-    If --chrome is specified, chrome tests will be run instead of web content tests.
-    If --browser-chrome is specified, browser-chrome tests will be run instead of web content tests.
-    See <http://mochikit.com/doc/html/MochiKit/Logging.html> for details on the logging levels.
-    """
+    """%(prog)s [options] [test paths]"""
 
     _containers = None
     context = {}
 
     def __init__(self, app=None, **kwargs):
         ArgumentParser.__init__(self, usage=self.__doc__, conflict_handler='resolve', **kwargs)
 
         self.oldcwd = os.getcwd()
--- a/testing/taskcluster/mach_commands.py
+++ b/testing/taskcluster/mach_commands.py
@@ -107,16 +107,36 @@ def decorate_task_treeherder_routes(task
     if 'routes' not in task:
         task['routes'] = []
 
     treeheder_env = task['extra'].get('treeherderEnv', ['staging'])
 
     for env in treeheder_env:
         task['routes'].append('{}.{}'.format(TREEHERDER_ROUTES[env], suffix))
 
+def decorate_task_json_routes(build, task, json_routes, parameters):
+    """
+    Decorate the given task with routes.json routes.
+
+    :param dict task: task definition.
+    :param json_routes: the list of routes to use from routes.json
+    :param parameters: dictionary of parameters to use in route templates
+    """
+    fmt = parameters.copy()
+    fmt.update({
+        'build_product': task['extra']['build_product'],
+        'build_name': build['build_name'],
+        'build_type': build['build_type'],
+    })
+    routes = task.get('routes', [])
+    for route in json_routes:
+        routes.append(route.format(**fmt))
+
+    task['routes'] = routes
+
 def configure_dependent_task(task_path, parameters, taskid, templates, build_treeherder_config):
     """
     Configure a build dependent task. This is shared between post-build and test tasks.
 
     :param task_path: location to the task yaml
     :param parameters: parameters to load the template
     :param taskid: taskid of the dependent task
     :param templates: reference to the template builder
@@ -262,16 +282,17 @@ class Graph(object):
 
         jobs = templates.load(job_path, {})
 
         job_graph = parse_commit(message, jobs)
         mozharness = load_mozharness_info()
 
         # Template parameters used when expanding the graph
         parameters = dict(gaia_info().items() + {
+            'index': 'index.garbage.staging.mshal-testing', #TODO
             'project': project,
             'pushlog_id': params.get('pushlog_id', 0),
             'docker_image': docker_image,
             'base_repository': params['base_repository'] or \
                 params['head_repository'],
             'head_repository': params['head_repository'],
             'head_ref': params['head_ref'] or params['head_rev'],
             'head_rev': params['head_rev'],
@@ -284,16 +305,22 @@ class Graph(object):
             'revision_hash': params['revision_hash']
         }.items())
 
         treeherder_route = '{}.{}'.format(
             params['project'],
             params.get('revision_hash', '')
         )
 
+        routes_file = os.path.join(ROOT, 'routes.json')
+        with open(routes_file) as f:
+            contents = json.load(f)
+            json_routes = contents['routes']
+            # TODO: Nightly and/or l10n routes
+
         # Task graph we are generating for taskcluster...
         graph = {
             'tasks': [],
             'scopes': []
         }
 
         if params['revision_hash']:
             for env in TREEHERDER_ROUTES:
@@ -307,22 +334,23 @@ class Graph(object):
             'name': 'task graph local'
         }
 
         for build in job_graph:
             build_parameters = dict(parameters)
             build_parameters['build_slugid'] = slugid()
             build_task = templates.load(build['task'], build_parameters)
 
-            if 'routes' not in build_task['task']:
-                build_task['task']['routes'] = []
-
             if params['revision_hash']:
                 decorate_task_treeherder_routes(build_task['task'],
                                                 treeherder_route)
+                decorate_task_json_routes(build,
+                                          build_task['task'],
+                                          json_routes,
+                                          build_parameters)
 
             # Ensure each build graph is valid after construction.
             taskcluster_graph.build_task.validate(build_task)
             graph['tasks'].append(build_task)
 
             test_packages_url, tests_url = None, None
 
             if 'test_packages' in build_task['task']['extra']['locations']:
--- a/testing/taskcluster/taskcluster_graph/commit_parser.py
+++ b/testing/taskcluster/taskcluster_graph/commit_parser.py
@@ -270,12 +270,14 @@ def parse_commit(message, jobs):
 
             # Node for this particular build type
             result.append({
                 'task': build_task,
                 'post-build': post_build_jobs,
                 'dependents': extract_tests_from_platform(
                     jobs['tests'], platform_builds, build_task, tests
                 ),
-                'additional-parameters': additional_parameters
+                'additional-parameters': additional_parameters,
+                'build_name': platform,
+                'build_type': build_type,
             })
 
     return result
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -24,16 +24,17 @@ function getLists(prefName) {
 }
 
 // These may be a comma-separated lists of tables.
 const phishingLists = getLists("urlclassifier.phishTable");
 const malwareLists = getLists("urlclassifier.malwareTable");
 const downloadBlockLists = getLists("urlclassifier.downloadBlockTable");
 const downloadAllowLists = getLists("urlclassifier.downloadAllowTable");
 const trackingProtectionLists = getLists("urlclassifier.trackingTable");
+const trackingProtectionWhitelists = getLists("urlclassifier.trackingWhitelistTable");
 
 var debug = false;
 function log(...stuff) {
   if (!debug)
     return;
 
   var d = new Date();
   let msg = "SafeBrowsing: " + d.toTimeString() + ": " + stuff.join(" ");
@@ -68,16 +69,21 @@ this.SafeBrowsing = {
     for (let i = 0; i < downloadAllowLists.length; ++i) {
       listManager.registerTable(downloadAllowLists[i], this.updateURL, this.gethashURL);
     }
     for (let i = 0; i < trackingProtectionLists.length; ++i) {
       listManager.registerTable(trackingProtectionLists[i],
                                 this.trackingUpdateURL,
                                 this.trackingGethashURL);
     }
+    for (let i = 0; i < trackingProtectionWhitelists.length; ++i) {
+      listManager.registerTable(trackingProtectionWhitelists[i],
+                                this.trackingUpdateURL,
+                                this.trackingGethashURL);
+    }
     this.addMozEntries();
 
     this.controlUpdateChecking();
     this.initialized = true;
 
     log("init() finished");
   },
 
@@ -195,64 +201,71 @@ this.SafeBrowsing = {
         listManager.enableUpdate(downloadAllowLists[i]);
       } else {
         listManager.disableUpdate(downloadAllowLists[i]);
       }
     }
     for (let i = 0; i < trackingProtectionLists.length; ++i) {
       if (this.trackingEnabled) {
         listManager.enableUpdate(trackingProtectionLists[i]);
+        listManager.enableUpdate(trackingProtectionWhitelists[i]);
       } else {
         listManager.disableUpdate(trackingProtectionLists[i]);
+        listManager.disableUpdate(trackingProtectionWhitelists[i]);
       }
     }
     listManager.maybeToggleUpdateChecking();
   },
 
 
   addMozEntries: function() {
     // Add test entries to the DB.
     // XXX bug 779008 - this could be done by DB itself?
     const phishURL    = "itisatrap.org/firefox/its-a-trap.html";
     const malwareURL  = "itisatrap.org/firefox/its-an-attack.html";
     const unwantedURL = "itisatrap.org/firefox/unwanted.html";
-    const trackerURLs  = [
+    const trackerURLs = [
       "trackertest.org/",
       "itisatracker.org/",
     ];
+    const whitelistURL = "itisatrap.org/?resource=itisatracker.org";
 
     let update = "n:1000\ni:test-malware-simple\nad:1\n" +
                  "a:1:32:" + malwareURL.length + "\n" +
-                 malwareURL;
+                 malwareURL + "\n";
     update += "n:1000\ni:test-phish-simple\nad:1\n" +
               "a:1:32:" + phishURL.length + "\n" +
-              phishURL;
+              phishURL  + "\n";
     update += "n:1000\ni:test-unwanted-simple\nad:1\n" +
               "a:1:32:" + unwantedURL.length + "\n" +
-              unwantedURL;
+              unwantedURL + "\n";
+    update += "n:1000\ni:test-track-simple\n" +
+              "ad:" + trackerURLs.length + "\n";
     trackerURLs.forEach((trackerURL, i) => {
-      update += "n:1000\ni:test-track-simple\nad:1\n" +
-                "a:" + (i + 1) + ":32:" + trackerURL.length + "\n" +
-                trackerURL;
+      update += "a:" + (i + 1) + ":32:" + trackerURL.length + "\n" +
+                trackerURL + "\n";
     });
+    update += "n:1000\ni:test-trackwhite-simple\nad:1\n" +
+              "a:1:32:" + whitelistURL.length + "\n" +
+              whitelistURL;
     log("addMozEntries:", update);
 
     let db = Cc["@mozilla.org/url-classifier/dbservice;1"].
              getService(Ci.nsIUrlClassifierDBService);
 
     // nsIUrlClassifierUpdateObserver
     let dummyListener = {
       updateUrlRequested: function() { },
       streamFinished:     function() { },
       updateError:        function() { },
       updateSuccess:      function() { }
     };
 
     try {
-      let tables = "test-malware-simple,test-phish-simple,test-unwanted-simple,test-track-simple";
+      let tables = "test-malware-simple,test-phish-simple,test-unwanted-simple,test-track-simple,test-trackwhite-simple";
       db.beginUpdate(dummyListener, tables, "");
       db.beginStream("", "");
       db.updateStream(update);
       db.finishStream();
       db.finishUpdate();
     } catch(ex) {
       // beginUpdate will throw harmlessly if there's an existing update in progress, ignore failures.
       log("addMozEntries failed!", ex);
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -73,16 +73,17 @@ PRLogModuleInfo *gUrlClassifierDbService
 
 #define GETHASH_NOISE_PREF      "urlclassifier.gethashnoise"
 #define GETHASH_NOISE_DEFAULT   4
 
 // Comma-separated lists
 #define MALWARE_TABLE_PREF      "urlclassifier.malwareTable"
 #define PHISH_TABLE_PREF        "urlclassifier.phishTable"
 #define TRACKING_TABLE_PREF     "urlclassifier.trackingTable"
+#define TRACKING_WHITELIST_TABLE_PREF "urlclassifier.trackingWhitelistTable"
 #define DOWNLOAD_BLOCK_TABLE_PREF "urlclassifier.downloadBlockTable"
 #define DOWNLOAD_ALLOW_TABLE_PREF "urlclassifier.downloadAllowTable"
 #define DISALLOW_COMPLETION_TABLE_PREF "urlclassifier.disallow_completions"
 
 #define CONFIRM_AGE_PREF        "urlclassifier.max-complete-age"
 #define CONFIRM_AGE_DEFAULT_SEC (45 * 60)
 
 class nsUrlClassifierDBServiceWorker;
@@ -1063,16 +1064,22 @@ nsUrlClassifierDBService::ReadTablesFrom
   }
 
   Preferences::GetCString(TRACKING_TABLE_PREF, &tables);
   if (!tables.IsEmpty()) {
     allTables.Append(',');
     allTables.Append(tables);
   }
 
+  Preferences::GetCString(TRACKING_WHITELIST_TABLE_PREF, &tables);
+  if (!tables.IsEmpty()) {
+    allTables.Append(',');
+    allTables.Append(tables);
+  }
+
   Classifier::SplitTables(allTables, mGethashTables);
 
   Preferences::GetCString(DISALLOW_COMPLETION_TABLE_PREF, &tables);
   Classifier::SplitTables(tables, mDisallowCompletionsTables);
 
   return NS_OK;
 }
 
@@ -1110,16 +1117,17 @@ nsUrlClassifierDBService::Init()
   Preferences::AddStrongObserver(this, CHECK_PHISHING_PREF);
   Preferences::AddStrongObserver(this, CHECK_TRACKING_PREF);
   Preferences::AddStrongObserver(this, CHECK_TRACKING_PB_PREF);
   Preferences::AddStrongObserver(this, GETHASH_NOISE_PREF);
   Preferences::AddStrongObserver(this, CONFIRM_AGE_PREF);
   Preferences::AddStrongObserver(this, PHISH_TABLE_PREF);
   Preferences::AddStrongObserver(this, MALWARE_TABLE_PREF);
   Preferences::AddStrongObserver(this, TRACKING_TABLE_PREF);
+  Preferences::AddStrongObserver(this, TRACKING_WHITELIST_TABLE_PREF);
   Preferences::AddStrongObserver(this, DOWNLOAD_BLOCK_TABLE_PREF);
   Preferences::AddStrongObserver(this, DOWNLOAD_ALLOW_TABLE_PREF);
   Preferences::AddStrongObserver(this, DISALLOW_COMPLETION_TABLE_PREF);
 
   // Force PSM loading on main thread
   nsresult rv;
   nsCOMPtr<nsICryptoHash> dummy = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1181,21 +1189,32 @@ nsUrlClassifierDBService::BuildTables(bo
     tables.Append(malware);
   }
   nsAutoCString phishing;
   Preferences::GetCString(PHISH_TABLE_PREF, &phishing);
   if (mCheckPhishing && !phishing.IsEmpty()) {
     tables.Append(',');
     tables.Append(phishing);
   }
-  nsAutoCString tracking;
-  Preferences::GetCString(TRACKING_TABLE_PREF, &tracking);
-  if (aTrackingProtectionEnabled && !tracking.IsEmpty()) {
-    tables.Append(',');
-    tables.Append(tracking);
+  if (aTrackingProtectionEnabled) {
+    nsAutoCString tracking, trackingWhitelist;
+    Preferences::GetCString(TRACKING_TABLE_PREF, &tracking);
+    if (!tracking.IsEmpty()) {
+      tables.Append(',');
+      tables.Append(tracking);
+    }
+    Preferences::GetCString(TRACKING_WHITELIST_TABLE_PREF, &trackingWhitelist);
+    if (!trackingWhitelist.IsEmpty()) {
+      tables.Append(',');
+      tables.Append(trackingWhitelist);
+    }
+  }
+
+  if (StringBeginsWith(tables, NS_LITERAL_CSTRING(","))) {
+    tables.Cut(0, 1);
   }
 }
 
 // nsChannelClassifier is the only consumer of this interface.
 NS_IMETHODIMP
 nsUrlClassifierDBService::Classify(nsIPrincipal* aPrincipal,
                                    bool aTrackingProtectionEnabled,
                                    nsIURIClassifierCallback* c,
@@ -1224,35 +1243,30 @@ nsUrlClassifierDBService::Classify(nsIPr
     return NS_OK;
   }
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsUrlClassifierDBService::ClassifyLocalWithTables(nsIPrincipal *aPrincipal,
+nsUrlClassifierDBService::ClassifyLocalWithTables(nsIURI *aURI,
                                                   const nsACString & aTables,
                                                   nsACString & aTableResults)
 {
   MOZ_ASSERT(NS_IsMainThread(), "ClassifyLocalWithTables must be on main thread");
 
-  nsCOMPtr<nsIURI> uri;
-  nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri));
-  NS_ENSURE_SUCCESS(rv, rv);
-  NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);
-
-  uri = NS_GetInnermostURI(uri);
+  nsCOMPtr<nsIURI> uri = NS_GetInnermostURI(aURI);
   NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);
 
   nsAutoCString key;
   // Canonicalize the url
   nsCOMPtr<nsIUrlClassifierUtils> utilsService =
     do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID);
-  rv = utilsService->GetKeyForURI(uri, key);
+  nsresult rv = utilsService->GetKeyForURI(uri, key);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoPtr<LookupResultArray> results(new LookupResultArray());
   if (!results) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   // In unittests, we may not have been initalized, so don't crash.
@@ -1508,16 +1522,17 @@ nsUrlClassifierDBService::Observe(nsISup
                NS_LITERAL_STRING(CHECK_TRACKING_PB_PREF).Equals(aData)) {
       mCheckTracking =
         Preferences::GetBool(CHECK_TRACKING_PREF, CHECK_TRACKING_DEFAULT) ||
         Preferences::GetBool(CHECK_TRACKING_PB_PREF, CHECK_TRACKING_PB_DEFAULT);
     } else if (
       NS_LITERAL_STRING(PHISH_TABLE_PREF).Equals(aData) ||
       NS_LITERAL_STRING(MALWARE_TABLE_PREF).Equals(aData) ||
       NS_LITERAL_STRING(TRACKING_TABLE_PREF).Equals(aData) ||
+      NS_LITERAL_STRING(TRACKING_WHITELIST_TABLE_PREF).Equals(aData) ||
       NS_LITERAL_STRING(DOWNLOAD_BLOCK_TABLE_PREF).Equals(aData) ||
       NS_LITERAL_STRING(DOWNLOAD_ALLOW_TABLE_PREF).Equals(aData) ||
       NS_LITERAL_STRING(DISALLOW_COMPLETION_TABLE_PREF).Equals(aData)) {
       // Just read everything again.
       ReadTablesFromPrefs();
     } else if (NS_LITERAL_STRING(CONFIRM_AGE_PREF).Equals(aData)) {
       gFreshnessGuarantee = Preferences::GetInt(CONFIRM_AGE_PREF,
         CONFIRM_AGE_DEFAULT_SEC);
@@ -1547,16 +1562,17 @@ nsUrlClassifierDBService::Shutdown()
   if (prefs) {
     prefs->RemoveObserver(CHECK_MALWARE_PREF, this);
     prefs->RemoveObserver(CHECK_PHISHING_PREF, this);
     prefs->RemoveObserver(CHECK_TRACKING_PREF, this);
     prefs->RemoveObserver(CHECK_TRACKING_PB_PREF, this);
     prefs->RemoveObserver(PHISH_TABLE_PREF, this);
     prefs->RemoveObserver(MALWARE_TABLE_PREF, this);
     prefs->RemoveObserver(TRACKING_TABLE_PREF, this);
+    prefs->RemoveObserver(TRACKING_WHITELIST_TABLE_PREF, this);
     prefs->RemoveObserver(DOWNLOAD_BLOCK_TABLE_PREF, this);
     prefs->RemoveObserver(DOWNLOAD_ALLOW_TABLE_PREF, this);
     prefs->RemoveObserver(DISALLOW_COMPLETION_TABLE_PREF, this);
     prefs->RemoveObserver(CONFIRM_AGE_PREF, this);
   }
 
   DebugOnly<nsresult> rv;
   // First close the db connection.
--- a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
+++ b/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
@@ -1,45 +1,74 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["UrlClassifierTestUtils"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
+const TRACKING_TABLE_NAME = "mochitest-track-simple";
+const TRACKING_TABLE_PREF = "urlclassifier.trackingTable";
+const WHITELIST_TABLE_NAME = "mochitest-trackwhite-simple";
+const WHITELIST_TABLE_PREF = "urlclassifier.trackingWhitelistTable";
+
 Cu.import("resource://gre/modules/Services.jsm");
 
 this.UrlClassifierTestUtils = {
 
   addTestTrackers() {
-    const TABLE_PREF = "urlclassifier.trackingTable";
-    const TABLE_NAME = "test-track-simple";
+    // Add some URLs to the tracking databases
+    let trackingURL1 = "tracking.example.com/";
+    let trackingURL2 = "itisatracker.org/";
+    let trackingURL3 = "trackertest.org/";
+    let whitelistedURL = "itisatrap.org/?resource=itisatracker.org";
 
-    // Add some URLs to the tracking database (to be blocked)
-    let testData = "tracking.example.com/";
-    let testUpdate =
-          "n:1000\ni:test-track-simple\nad:1\n" +
-          "a:524:32:" + testData.length + "\n" +
-          testData;
+    let trackingUpdate =
+          "n:1000\ni:" + TRACKING_TABLE_NAME + "\nad:3\n" +
+          "a:1:32:" + trackingURL1.length + "\n" +
+          trackingURL1 + "\n" +
+          "a:2:32:" + trackingURL2.length + "\n" +
+          trackingURL2 + "\n" +
+          "a:3:32:" + trackingURL3.length + "\n" +
+          trackingURL3 + "\n";
+    let whitelistUpdate =
+          "n:1000\ni:" + WHITELIST_TABLE_NAME + "\nad:1\n" +
+          "a:1:32:" + whitelistedURL.length + "\n" +
+          whitelistedURL + "\n";
 
-    return this.useTestDatabase(TABLE_PREF, TABLE_NAME, testUpdate);
+    var tables = [
+      {
+        pref: TRACKING_TABLE_PREF,
+        name: TRACKING_TABLE_NAME,
+        update: trackingUpdate
+      },
+      {
+        pref: WHITELIST_TABLE_PREF,
+        name: WHITELIST_TABLE_NAME,
+        update: whitelistUpdate
+      }
+    ];
+
+    return this.useTestDatabase(tables);
   },
 
   cleanupTestTrackers() {
-    const TABLE_PREF = "urlclassifier.trackingTable";
-    Services.prefs.clearUserPref(TABLE_PREF);
+    Services.prefs.clearUserPref(TRACKING_TABLE_PREF);
+    Services.prefs.clearUserPref(WHITELIST_TABLE_PREF);
   },
 
   /**
    * Add some entries to a test tracking protection database, and resets
    * back to the default database after the test ends.
    *
    * @return {Promise}
    */
-  useTestDatabase(tablePref, tableName, update) {
-    Services.prefs.setCharPref(tablePref, tableName);
+  useTestDatabase(tables) {
+    for (var table of tables) {
+      Services.prefs.setCharPref(table.pref, table.name);
+    }
 
     return new Promise((resolve, reject) => {
       let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"].
                       getService(Ci.nsIUrlClassifierDBService);
       let listener = {
         QueryInterface: iid => {
           if (iid.equals(Ci.nsISupports) ||
               iid.equals(Ci.nsIUrlClassifierUpdateObserver))
@@ -52,16 +81,18 @@ this.UrlClassifierTestUtils = {
         updateError: errorCode => {
           reject("Couldn't update classifier.");
         },
         updateSuccess: requestedTimeout => {
           resolve();
         }
       };
 
-      dbService.beginUpdate(listener, tableName, "");
-      dbService.beginStream("", "");
-      dbService.updateStream(update);
-      dbService.finishStream();
-      dbService.finishUpdate();
+      for (var table of tables) {
+        dbService.beginUpdate(listener, table.name, "");
+        dbService.beginStream("", "");
+        dbService.updateStream(table.update);
+        dbService.finishStream();
+        dbService.finishUpdate();
+      }
     });
   },
 };
--- a/toolkit/components/url-classifier/tests/mochitest/chrome.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/chrome.ini
@@ -9,8 +9,10 @@ support-files =
 [test_classified_annotations.html]
 tags = trackingprotection
 [test_allowlisted_annotations.html]
 tags = trackingprotection
 [test_privatebrowsing_trackingprotection.html]
 tags = trackingprotection
 [test_trackingprotection_bug1157081.html]
 tags = trackingprotection
+[test_trackingprotection_whitelist.html]
+tags = trackingprotection
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html
@@ -7,16 +7,18 @@
 
 <link id="badcss" rel="stylesheet" type="text/css" href="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
 
 </head>
 <body>
 
 <script id="badscript" data-touched="not sure" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
 
+<script id="goodscript" data-touched="not sure" src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/good.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
+
 <!-- The image cache can cache JS handlers, so make sure we use a different URL for raptor.jpg each time -->
 <img id="badimage" data-touched="not sure" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg?pbmode=test" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"/>
 
 The following should not be hidden:
 <div id="styleCheck">STYLE TEST</div>
 
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/toolkit/components/url-classifier/tests/mochitest/good.js
@@ -0,0 +1,1 @@
+scriptItem = "loaded whitelisted javascript!";
--- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
@@ -1,16 +1,19 @@
 [DEFAULT]
 skip-if = buildapp == 'b2g' || e10s
 support-files =
+  classifiedAnnotatedPBFrame.html
   classifierFrame.html
   cleanWorker.js
+  good.js
   evil.css
   evil.js
   evilWorker.js
   import.css
   raptor.jpg
   track.html
   unwantedWorker.js
+  whitelistFrame.html
   workerFrame.html
 
 [test_classifier.html]
 [test_classifier_worker.html]
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
@@ -20,17 +20,17 @@ var Cc = SpecialPowers.Cc;
 var Ci = SpecialPowers.Ci;
 
 var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIWebNavigation)
                     .QueryInterface(Ci.nsIDocShellTreeItem)
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
-var contentPage = "chrome://mochitests/content/chrome/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html"
+var contentPage = "http://www.itisatrap.org/tests/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html";
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
 
 function whenDelayedStartupFinished(aWindow, aCallback) {
   Services.obs.addObserver(function observer(aSubject, aTopic) {
     if (aWindow == aSubject) {
       Services.obs.removeObserver(observer, aTopic);
@@ -66,16 +66,17 @@ var badids = [
   "badimage",
   "badcss"
 ];
 
 function checkLoads(aWindow, aBlocked) {
   var win = aWindow.content;
   is(win.document.getElementById("badscript").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking javascript");
   is(win.document.getElementById("badimage").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking images");
+  is(win.document.getElementById("goodscript").dataset.touched, "yes", "Should load whitelisted tracking javascript");
 
   var elt = win.document.getElementById("styleCheck");
   var style = win.document.defaultView.getComputedStyle(elt, "");
   isnot(style.visibility, aBlocked ? "hidden" : "", "Should not load tracking css");
 
   is(win.document.blockedTrackingNodeCount, aBlocked ? badids.length : 0, "Should identify all tracking elements");
 
   var blockedTrackingNodes = win.document.blockedTrackingNodes;
copy from toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
copy to toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
@@ -20,32 +20,33 @@ var Cc = SpecialPowers.Cc;
 var Ci = SpecialPowers.Ci;
 
 var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIWebNavigation)
                     .QueryInterface(Ci.nsIDocShellTreeItem)
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
-var contentPage = "chrome://mochitests/content/chrome/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html"
+var contentPage1 = "http://www.itisatrap.org/tests/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html";
+var contentPage2 = "http://example.com/tests/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html";
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
 
 function whenDelayedStartupFinished(aWindow, aCallback) {
   Services.obs.addObserver(function observer(aSubject, aTopic) {
     if (aWindow == aSubject) {
       Services.obs.removeObserver(observer, aTopic);
       setTimeout(aCallback, 0);
     }
   }, "browser-delayed-startup-finished", false);
 }
 
-function testOnWindow(aPrivate, aCallback) {
-  var win = mainWindow.OpenBrowserWindow({private: aPrivate});
+function testOnWindow(contentPage, aCallback) {
+  var win = mainWindow.OpenBrowserWindow();
   win.addEventListener("load", function onLoad() {
     win.removeEventListener("load", onLoad, false);
     whenDelayedStartupFinished(win, function() {
       win.addEventListener("DOMContentLoaded", function onInnerLoad() {
         if (win.content.location.href != contentPage) {
           win.gBrowser.loadURI(contentPage);
           return;
         }
@@ -56,32 +57,30 @@ function testOnWindow(aPrivate, aCallbac
           SimpleTest.executeSoon(function() { aCallback(win); });
         }, false, true);
       }, true);
       SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
     });
   }, true);
 }
 
-var badids = [
+var alwaysbadids = [
   "badscript",
-  "badimage",
-  "badcss"
 ];
 
-function checkLoads(aWindow, aBlocked) {
+function checkLoads(aWindow, aWhitelisted) {
   var win = aWindow.content;
-  is(win.document.getElementById("badscript").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking javascript");
-  is(win.document.getElementById("badimage").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking images");
+  is(win.document.getElementById("badscript").dataset.touched, "no", "Should not load tracking javascript");
+  is(win.document.getElementById("goodscript").dataset.touched, aWhitelisted ? "yes" : "no", "Should load whitelisted tracking javascript");
 
-  var elt = win.document.getElementById("styleCheck");
-  var style = win.document.defaultView.getComputedStyle(elt, "");
-  isnot(style.visibility, aBlocked ? "hidden" : "", "Should not load tracking css");
-
-  is(win.document.blockedTrackingNodeCount, aBlocked ? badids.length : 0, "Should identify all tracking elements");
+  var badids = alwaysbadids.slice();
+  if (!aWhitelisted) {
+    badids.push("goodscript");
+  }
+  is(win.document.blockedTrackingNodeCount, badids.length, "Should identify all tracking elements");
 
   var blockedTrackingNodes = win.document.blockedTrackingNodes;
 
   // Make sure that every node in blockedTrackingNodes exists in the tree
   // (that may not always be the case but do not expect any nodes to disappear
   // from the tree here)
   var allNodeMatch = true;
   for (var i = 0; i < blockedTrackingNodes.length; i++) {
@@ -103,43 +102,41 @@ function checkLoads(aWindow, aBlocked) {
     var nodeMatch = false;
     for (var i = 0; i < blockedTrackingNodes.length && !nodeMatch; i++) {
       nodeMatch = nodeMatch ||
         (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
     }
 
     allNodeMatch = allNodeMatch && nodeMatch;
   }
-  is(allNodeMatch, aBlocked, "All tracking nodes are expected to be annotated as such");
+  is(allNodeMatch, true, "All tracking nodes are expected to be annotated as such");
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
-            ["privacy.trackingprotection.enabled", false],
-            ["privacy.trackingprotection.pbmode.enabled", true],
+  {"set" : [["privacy.trackingprotection.enabled", true],
             ["channelclassifier.allowlist_example", true]]},
   test);
 
 function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   UrlClassifierTestUtils.addTestTrackers().then(() => {
-    // Normal mode, with the pref (trackers should be loaded)
-    testOnWindow(false, function(aWindow) {
-      checkLoads(aWindow, false);
+    // Load the test from a URL on the whitelist
+    testOnWindow(contentPage1, function(aWindow) {
+      checkLoads(aWindow, true);
       aWindow.close();
 
-      // Private Browsing, with the pref (trackers should be blocked)
-      testOnWindow(true, function(aWindow) {
-        checkLoads(aWindow, true);
+      // Load the test from a URL that's NOT on the whitelist
+      testOnWindow(contentPage2, function(aWindow) {
+        checkLoads(aWindow, false);
         aWindow.close();
 
-        // Private Browsing, without the pref (trackers should be loaded)
-        SpecialPowers.setBoolPref("privacy.trackingprotection.pbmode.enabled", false);
-        testOnWindow(true, function(aWindow) {
-          checkLoads(aWindow, false);
+        // Load the test from a URL on the whitelist but without the whitelist
+        SpecialPowers.setCharPref("urlclassifier.trackingWhitelistTable", "");
+        testOnWindow(contentPage1, function(aWindow) {
+        checkLoads(aWindow, false);
           aWindow.close();
           SimpleTest.finish();
         });
       });
     });
   });
 }
 
copy from toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html
copy to toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html
@@ -1,22 +1,15 @@
 <!DOCTYPE HTML>
 <!-- Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/ -->
 <html>
 <head>
 <title></title>
-
-<link id="badcss" rel="stylesheet" type="text/css" href="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
-
 </head>
 <body>
 
-<script id="badscript" data-touched="not sure" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
+<script id="badscript" data-touched="not sure" src="http://trackertest.org/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
 
-<!-- The image cache can cache JS handlers, so make sure we use a different URL for raptor.jpg each time -->
-<img id="badimage" data-touched="not sure" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg?pbmode=test" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"/>
-
-The following should not be hidden:
-<div id="styleCheck">STYLE TEST</div>
+<script id="goodscript" data-touched="not sure" src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/good.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
 
 </body>
 </html>
--- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
+++ b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
@@ -50,29 +50,32 @@ function delFile(name) {
 
 function cleanUp() {
   delFile("urlclassifier3.sqlite");
   delFile("safebrowsing/classifier.hashkey");
   delFile("safebrowsing/test-phish-simple.sbstore");
   delFile("safebrowsing/test-malware-simple.sbstore");
   delFile("safebrowsing/test-unwanted-simple.sbstore");
   delFile("safebrowsing/test-track-simple.sbstore");
+  delFile("safebrowsing/test-trackwhite-simple.sbstore");
   delFile("safebrowsing/test-phish-simple.cache");
   delFile("safebrowsing/test-malware-simple.cache");
   delFile("safebrowsing/test-unwanted-simple.cache");
   delFile("safebrowsing/test-track-simple.cache");
+  delFile("safebrowsing/test-trackwhite-simple.cache");
   delFile("safebrowsing/test-phish-simple.pset");
   delFile("safebrowsing/test-malware-simple.pset");
   delFile("safebrowsing/test-unwanted-simple.pset");
   delFile("safebrowsing/test-track-simple.pset");
+  delFile("safebrowsing/test-trackwhite-simple.pset");
   delFile("testLarge.pset");
   delFile("testNoDelta.pset");
 }
 
-var allTables = "test-phish-simple,test-malware-simple,test-unwanted-simple,test-track-simple";
+var allTables = "test-phish-simple,test-malware-simple,test-unwanted-simple,test-track-simple,test-trackwhite-simple";
 
 var dbservice = Cc["@mozilla.org/url-classifier/dbservice;1"].getService(Ci.nsIUrlClassifierDBService);
 var streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"]
                     .getService(Ci.nsIUrlClassifierStreamUpdater);
 
 
 /*
  * Builds an update from an object that looks like: