Merge inbound to mozilla-central. a=merge
authorshindli <shindli@mozilla.com>
Sun, 07 Oct 2018 00:11:08 +0300
changeset 495650 07c609fc8eb8
parent 495637 8248b734eb88 (current diff)
parent 495649 ce95adbcf2e4 (diff)
child 495659 6b1761e26984
child 495669 45da44f3bfe5
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone64.0a1
first release with
nightly linux32
07c609fc8eb8 / 64.0a1 / 20181006220113 / files
nightly linux64
07c609fc8eb8 / 64.0a1 / 20181006220113 / files
nightly mac
07c609fc8eb8 / 64.0a1 / 20181006220113 / files
nightly win32
07c609fc8eb8 / 64.0a1 / 20181006220113 / files
nightly win64
07c609fc8eb8 / 64.0a1 / 20181006220113 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
build/build-clang/clang-win32-st-an.json
build/build-clang/msvc-host-x64.patch
gfx/layers/wr/WebRenderCommandBuilder.cpp
gfx/webrender_bindings/src/bindings.rs.rej
taskcluster/scripts/misc/build-clang32-st-an-windows.sh
--- a/browser/components/payments/content/paymentDialogWrapper.js
+++ b/browser/components/payments/content/paymentDialogWrapper.js
@@ -262,16 +262,17 @@ var paymentDialogWrapper = {
                                    billingAddress);
     return basicCardResponseData;
   },
 
   createPaymentAddress({
     country = "",
     addressLines = [],
     region = "",
+    regionCode = "",
     city = "",
     dependentLocality = "",
     postalCode = "",
     sortingCode = "",
     organization = "",
     recipient = "",
     phone = "",
   }) {
@@ -281,16 +282,17 @@ var paymentDialogWrapper = {
     for (let line of addressLines) {
       const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
       address.data = line;
       addressLine.appendElement(address);
     }
     paymentAddress.init(country,
                         addressLine,
                         region,
+                        regionCode,
                         city,
                         dependentLocality,
                         postalCode,
                         sortingCode,
                         organization,
                         recipient,
                         phone);
     return paymentAddress;
--- a/browser/config/mozconfigs/win32/clang
+++ b/browser/config/mozconfigs/win32/clang
@@ -5,14 +5,16 @@ MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --enable-optimize
 
 ac_add_options --enable-clang-plugin
 
 . $topsrcdir/build/win32/mozconfig.vs-latest
-# Regardless of what mozconfig.vs-latest sets, clang-plugin builds need to use
-# the Microsoft linker until at least bugs 1414287 and 1427808 are resolved.
+
+# Regardless of what mozconfig.vs-latest sets, lld-link that comes with the old
+# clang version used for static analysis fails to link multiple things. So
+# until bug 1427808 is resolved, use the Microsoft linker.
 export LINKER=link
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.clang-cl"
--- a/browser/config/mozconfigs/win32/clang-debug
+++ b/browser/config/mozconfigs/win32/clang-debug
@@ -6,14 +6,16 @@ MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --enable-optimize
 ac_add_options --enable-debug
 
 ac_add_options --enable-clang-plugin
 
 . $topsrcdir/build/win32/mozconfig.vs-latest
-# Regardless of what mozconfig.vs-latest sets, clang-plugin builds need to use
-# the Microsoft linker until at least bugs 1414287 and 1427808 are resolved.
+
+# Regardless of what mozconfig.vs-latest sets, lld-link that comes with the old
+# clang version used for static analysis fails to link multiple things. So
+# until bug 1427808 is resolved, use the Microsoft linker.
 export LINKER=link
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.clang-cl"
deleted file mode 100644
--- a/build/build-clang/clang-win32-st-an.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-    "llvm_revision": "317840",
-    "stages": "3",
-    "build_libcxx": false,
-    "build_type": "Release",
-    "assertions": false,
-    "llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
-    "clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
-    "lld_repo": "https://llvm.org/svn/llvm-project/lld/trunk",
-    "compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
-    "libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
-    "python_path": "c:/mozilla-build/python/python.exe",
-    "cc": "cl.exe",
-    "cxx": "cl.exe",
-    "patches": [
-      "r318309.patch",
-      "r320462.patch",
-      "msvc-host-x64.patch",
-      "aarch64-vastart-checking.patch",
-      "loosen-msvc-detection.patch"
-    ]
-}
deleted file mode 100644
--- a/build/build-clang/msvc-host-x64.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-When looking for a linker, 32-bit clang-cl.exe wants to use the 32-bit-native link.exe located in Hostx86/x86, but this executable does not exist in our releng package, because we only use 64-bit-host toolchains.
-
-This patch makes clang-cl use the Hostx64/x86 linker instead. Ideally we wouldn't be using 32-bit clang-cl.exe in the first place. Bug 1414287 is on file to do so and remove this hack.
-
-diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp
---- a/clang/lib/Driver/ToolChains/MSVC.cpp
-+++ b/clang/lib/Driver/ToolChains/MSVC.cpp
-@@ -817,8 +816,7 @@
-   switch (Type) {
-   case SubDirectoryType::Bin:
-     if (VSLayout == ToolsetLayout::VS2017OrNewer) {
--      const bool HostIsX64 =
--          llvm::Triple(llvm::sys::getProcessTriple()).isArch64Bit();
-+      const bool HostIsX64 = true;
-       const char *const HostName = HostIsX64 ? "HostX64" : "HostX86";
-       llvm::sys::path::append(Path, "bin", HostName, SubdirName);
-     } else { // OlderVS or DevDivInternal
--- a/build/win32/mozconfig.vs2017
+++ b/build/win32/mozconfig.vs2017
@@ -16,16 +16,19 @@ if [ -d "${VSPATH}" ]; then
 
     export INCLUDE="${VSPATH}/VC/include:${VSPATH}/VC/atlmfc/include:${VSPATH}/SDK/Include/10.0.17134.0/ucrt:${VSPATH}/SDK/Include/10.0.17134.0/shared:${VSPATH}/SDK/Include/10.0.17134.0/um:${VSPATH}/SDK/Include/10.0.17134.0/winrt:${VSPATH}/DIA SDK/include"
     export LIB="${VSPATH}/VC/lib/x86:${VSPATH}/VC/atlmfc/lib/x86:${VSPATH}/SDK/Lib/10.0.17134.0/ucrt/x86:${VSPATH}/SDK/Lib/10.0.17134.0/um/x86:${VSPATH}/DIA SDK/lib"
 
     export WIN64_LINK="${VSPATH}/VC/bin/Hostx64/x64/link.exe"
     export WIN64_LIB="${VSPATH}/VC/lib/x64:${VSPATH}/VC/atlmfc/lib/x64:${VSPATH}/SDK/Lib/10.0.17134.0/ucrt/x64:${VSPATH}/SDK/Lib/10.0.17134.0/um/x64:${VSPATH}/DIA SDK/lib/amd64"
 fi
 
+ac_add_options --target=i686-pc-mingw32
+ac_add_options --host=x86_64-pc-mingw32
+
 . $topsrcdir/build/mozconfig.vs-common
 
 mk_export_correct_style WINDOWSSDKDIR
 mk_export_correct_style WIN32_REDIST_DIR
 mk_export_correct_style WIN_UCRT_REDIST_DIR
 mk_export_correct_style WIN_DIA_SDK_BIN_DIR
 mk_export_correct_style PATH
 mk_export_correct_style INCLUDE
--- a/config/config.mk
+++ b/config/config.mk
@@ -196,16 +196,23 @@ COMPILE_CMFLAGS = $(MOZ_LTO_CFLAGS) $(OS
 COMPILE_CMMFLAGS = $(MOZ_LTO_CFLAGS) $(OS_COMPILE_CMMFLAGS) $(MOZBUILD_CMMFLAGS)
 ASFLAGS = $(COMPUTED_ASFLAGS)
 SFLAGS = $(COMPUTED_SFLAGS)
 
 HOST_CFLAGS = $(COMPUTED_HOST_CFLAGS) $(_DEPEND_CFLAGS)
 HOST_CXXFLAGS = $(COMPUTED_HOST_CXXFLAGS) $(_DEPEND_CFLAGS)
 HOST_C_LDFLAGS = $(COMPUTED_HOST_C_LDFLAGS)
 HOST_CXX_LDFLAGS = $(COMPUTED_HOST_CXX_LDFLAGS)
+# Win32 Cross-builds on win64 need to override LIB when invoking the linker,
+# which we do for rust through cargo-linker.bat, so we abuse it here.
+# Ideally, we'd empty LIB and pass -LIBPATH options to the linker somehow but
+# we don't have this in place for rust, so...
+ifdef WIN64_CARGO_LINKER
+HOST_LINKER = $(topobjdir)/build/win64/cargo-linker.bat
+endif
 
 ifdef MOZ_LTO
 ifeq (Darwin,$(OS_TARGET))
 # When linking on macOS, debug info is not linked along with the final binary,
 # and the dwarf data stays in object files until they are "linked" with the
 # dsymutil tool.
 # With LTO, object files are temporary, and are not kept around, which
 # means there's no object file for dsymutil to do its job. Consequently,
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -4,16 +4,17 @@
  * 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 "nsGeolocation.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/CycleCollectedJSContext.h" // for nsAutoMicroTask
 #include "mozilla/dom/ContentChild.h"
+#include "mozilla/dom/FeaturePolicyUtils.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/PositionError.h"
 #include "mozilla/dom/PositionErrorBinding.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Unused.h"
@@ -1157,16 +1158,33 @@ Geolocation::ShouldBlockInsecureRequests
                                     "GeolocationInsecureRequestIsForbidden");
     return true;
   }
 
   return false;
 }
 
 bool
+Geolocation::FeaturePolicyBlocked() const
+{
+  nsCOMPtr<nsPIDOMWindowInner> win = do_QueryReferent(mOwner);
+  if (!win) {
+    return true;
+  }
+
+  nsCOMPtr<nsIDocument> doc = win->GetExtantDoc();
+  if (!doc) {
+    return false;
+  }
+
+  return FeaturePolicyUtils::IsFeatureAllowed(doc,
+                                              NS_LITERAL_STRING("geolocation"));
+}
+
+bool
 Geolocation::ClearPendingRequest(nsGeolocationRequest* aRequest)
 {
   if (aRequest->IsWatch() && this->IsAlreadyCleared(aRequest)) {
     this->NotifyAllowedRequest(aRequest);
     this->ClearWatch(aRequest->WatchId());
     return true;
   }
 
@@ -1216,17 +1234,18 @@ Geolocation::GetCurrentPosition(GeoPosit
                         static_cast<uint8_t>(mProtocolType));
 
   nsIEventTarget* target = MainThreadTarget(this);
   RefPtr<nsGeolocationRequest> request =
     new nsGeolocationRequest(this, std::move(callback), std::move(errorCallback),
                              std::move(options), static_cast<uint8_t>(mProtocolType), target,
                              false, EventStateManager::IsHandlingUserInput());
 
-  if (!sGeoEnabled || ShouldBlockInsecureRequests()) {
+  if (!sGeoEnabled || ShouldBlockInsecureRequests() ||
+      !FeaturePolicyBlocked()) {
     nsCOMPtr<nsIRunnable> ev = new RequestAllowEvent(false, request);
     target->Dispatch(ev.forget());
     return NS_OK;
   }
 
   if (!mOwner && aCallerType != CallerType::System) {
     return NS_ERROR_FAILURE;
   }
@@ -1299,17 +1318,18 @@ Geolocation::WatchPosition(GeoPositionCa
 
   nsIEventTarget* target = MainThreadTarget(this);
   RefPtr<nsGeolocationRequest> request =
     new nsGeolocationRequest(this, std::move(aCallback), std::move(aErrorCallback),
                              std::move(aOptions),
                              static_cast<uint8_t>(mProtocolType), target, true,
                              EventStateManager::IsHandlingUserInput(), watchId);
 
-  if (!sGeoEnabled || ShouldBlockInsecureRequests()) {
+  if (!sGeoEnabled || ShouldBlockInsecureRequests() ||
+      !FeaturePolicyBlocked()) {
     nsCOMPtr<nsIRunnable> ev = new RequestAllowEvent(false, request);
     target->Dispatch(ev.forget());
     return watchId;
   }
 
   if (!mOwner && aCallerType != CallerType::System) {
     aRv.Throw(NS_ERROR_FAILURE);
     return -1;
--- a/dom/geolocation/nsGeolocation.h
+++ b/dom/geolocation/nsGeolocation.h
@@ -202,16 +202,20 @@ private:
 
   // Check if clearWatch is already called
   bool IsAlreadyCleared(nsGeolocationRequest* aRequest);
 
   // Returns whether the Geolocation object should block requests
   // within a context that is not secure.
   bool ShouldBlockInsecureRequests() const;
 
+  // Return whather the Feature 'geolocation' is blocked by FeaturePolicy
+  // directive.
+  bool FeaturePolicyBlocked() const;
+
   // Two callback arrays.  The first |mPendingCallbacks| holds objects for only
   // one callback and then they are released/removed from the array.  The second
   // |mWatchingCallbacks| holds objects until the object is explictly removed or
   // there is a page change. All requests held by either array are active, that
   // is, they have been allowed and expect to be fulfilled.
 
   nsTArray<RefPtr<nsGeolocationRequest> > mPendingCallbacks;
   nsTArray<RefPtr<nsGeolocationRequest> > mWatchingCallbacks;
--- a/dom/interfaces/payments/nsIPaymentAddress.idl
+++ b/dom/interfaces/payments/nsIPaymentAddress.idl
@@ -8,27 +8,29 @@
 interface nsIArray;
 
 [builtinclass, scriptable, uuid(49a02241-7e48-477a-9345-9f246925dcb3)]
 interface nsIPaymentAddress : nsISupports
 {
   readonly attribute AString country;
   readonly attribute nsIArray addressLine;
   readonly attribute AString region;
+  readonly attribute AString regionCode;
   readonly attribute AString city;
   readonly attribute AString dependentLocality;
   readonly attribute AString postalCode;
   readonly attribute AString sortingCode;
   readonly attribute AString organization;
   readonly attribute AString recipient;
   readonly attribute AString phone;
 
   void init(in AString aCountry,
             in nsIArray aAddressLine,
             in AString aRegion,
+            in AString aRegionCode,
             in AString aCity,
             in AString aDependentLocality,
             in AString aPostalCode,
             in AString aSortingCode,
             in AString aOrganization,
             in AString aRecipient,
             in AString aPhone);
 };
--- a/dom/payments/BasicCardPayment.cpp
+++ b/dom/payments/BasicCardPayment.cpp
@@ -31,16 +31,17 @@ namespace dom {
 #define CardNumber NS_LITERAL_STRING("cardNumber")
 #define ExpiryMonth NS_LITERAL_STRING("expiryMonth")
 #define ExpiryYear NS_LITERAL_STRING("expiryYear")
 #define CardSecurityCode NS_LITERAL_STRING("cardSecurityCode")
 
 #define Country NS_LITERAL_STRING("country")
 #define AddressLine NS_LITERAL_STRING("addressLine")
 #define Region NS_LITERAL_STRING("region")
+#define RegionCode NS_LITERAL_STRING("regionCode")
 #define City NS_LITERAL_STRING("city")
 #define DependentLocality NS_LITERAL_STRING("dependentLocality")
 #define PostalCode NS_LITERAL_STRING("postalCode")
 #define SortingCode NS_LITERAL_STRING("sortingCode")
 #define Organization NS_LITERAL_STRING("organization")
 #define Recipient NS_LITERAL_STRING("recipient")
 #define Phone NS_LITERAL_STRING("phone")
 
@@ -109,16 +110,17 @@ bool IsBasicCardKey(const nsAString& aKe
          CardSecurityCode.Equals(aKey);
 }
 
 bool IsAddressKey(const nsAString& aKey)
 {
   return Country.Equals(aKey) ||
          AddressLine.Equals(aKey) ||
          Region.Equals(aKey) ||
+         RegionCode.Equals(aKey) ||
          City.Equals(aKey) ||
          DependentLocality.Equals(aKey) ||
          PostalCode.Equals(aKey) ||
          SortingCode.Equals(aKey) ||
          Organization.Equals(aKey) ||
          Recipient.Equals(aKey) ||
          Phone.Equals(aKey);
 }
@@ -253,16 +255,17 @@ BasicCardService::EncodeBasicCardData(co
     nsCOMPtr<nsISupportsString> address = do_QueryElementAt(addressLine, index);
     MOZ_ASSERT(address);
     nsAutoString addressString;
     NS_ENSURE_SUCCESS(address->GetData(addressString), NS_ERROR_FAILURE);
     addressLineString += addressString + AddressLineSpliter;
   }
   EncodeBasicCardProperty(AddressLine ,addressLineString , aResult);
   EncodeAddressProperty(aBillingAddress, Region, aResult);
+  EncodeAddressProperty(aBillingAddress, RegionCode, aResult);
   EncodeAddressProperty(aBillingAddress, City, aResult);
   EncodeAddressProperty(aBillingAddress, DependentLocality, aResult);
   EncodeAddressProperty(aBillingAddress, PostalCode, aResult);
   EncodeAddressProperty(aBillingAddress, SortingCode, aResult);
   EncodeAddressProperty(aBillingAddress, Organization, aResult);
   EncodeAddressProperty(aBillingAddress, Recipient, aResult);
   EncodeAddressProperty(aBillingAddress, Phone, aResult);
   return NS_OK;
@@ -273,16 +276,17 @@ BasicCardService::DecodeBasicCardData(co
                                       nsPIDOMWindowInner* aWindow,
                                       BasicCardResponse& aResponse)
 {
   // aWindow can be nullptr
   bool isBillingAddressPassed = false;
   nsTArray<nsString> addressLine;
   nsAutoString country;
   nsAutoString region;
+  nsAutoString regionCode;
   nsAutoString city;
   nsAutoString dependentLocality;
   nsAutoString postalCode;
   nsAutoString sortingCode;
   nsAutoString organization;
   nsAutoString recipient;
   nsAutoString phone;
 
@@ -306,16 +310,17 @@ BasicCardService::DecodeBasicCardData(co
 
     DecodeBasicCardProperty(key, value, CardholderName, aResponse);
     DecodeBasicCardProperty(key, value, ExpiryMonth, aResponse);
     DecodeBasicCardProperty(key, value, ExpiryYear, aResponse);
     DecodeBasicCardProperty(key, value, CardSecurityCode, aResponse);
 
     DecodeAddressProperty(key, value, Country, country);
     DecodeAddressProperty(key, value, Region, region);
+    DecodeAddressProperty(key, value, RegionCode, regionCode);
     DecodeAddressProperty(key, value, City, city);
     DecodeAddressProperty(key, value, DependentLocality, dependentLocality);
     DecodeAddressProperty(key, value, PostalCode, postalCode);
     DecodeAddressProperty(key, value, SortingCode, sortingCode);
     DecodeAddressProperty(key, value, Organization, organization);
     DecodeAddressProperty(key, value, Recipient, recipient);
     DecodeAddressProperty(key, value, Phone, phone);
 
@@ -327,16 +332,17 @@ BasicCardService::DecodeBasicCardData(co
     }
   }
   if (isBillingAddressPassed) {
     aResponse.mBillingAddress.Construct();
     aResponse.mBillingAddress.Value() = new PaymentAddress(aWindow,
                                                            country,
                                                            addressLine,
                                                            region,
+                                                           regionCode,
                                                            city,
                                                            dependentLocality,
                                                            postalCode,
                                                            sortingCode,
                                                            organization,
                                                            recipient,
                                                            phone);
   }
@@ -374,16 +380,17 @@ BasicCardService::IsValidBasicCardErrors
 #undef CardholderName
 #undef CardNumber
 #undef ExpiryMonth
 #undef ExpiryYear
 #undef CardSecurityCode
 #undef Country
 #undef AddressLine
 #undef Region
+#undef RegionCode
 #undef City
 #undef DependentLocality
 #undef PostalCode
 #undef SortingCode
 #undef Organization
 #undef Recipient
 #undef Phone
 #undef PropertySpliter
--- a/dom/payments/PaymentAddress.cpp
+++ b/dom/payments/PaymentAddress.cpp
@@ -19,26 +19,28 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 PaymentAddress::PaymentAddress(nsPIDOMWindowInner* aWindow,
                                const nsAString& aCountry,
                                const nsTArray<nsString>& aAddressLine,
                                const nsAString& aRegion,
+                               const nsAString& aRegionCode,
                                const nsAString& aCity,
                                const nsAString& aDependentLocality,
                                const nsAString& aPostalCode,
                                const nsAString& aSortingCode,
                                const nsAString& aOrganization,
                                const nsAString& aRecipient,
                                const nsAString& aPhone)
   : mCountry(aCountry)
   , mAddressLine(aAddressLine)
   , mRegion(aRegion)
+  , mRegionCode(aRegionCode)
   , mCity(aCity)
   , mDependentLocality(aDependentLocality)
   , mPostalCode(aPostalCode)
   , mSortingCode(aSortingCode)
   , mOrganization(aOrganization)
   , mRecipient(aRecipient)
   , mPhone(aPhone)
   , mOwner(aWindow)
@@ -59,16 +61,22 @@ PaymentAddress::GetAddressLine(nsTArray<
 
 void
 PaymentAddress::GetRegion(nsAString& aRetVal) const
 {
   aRetVal = mRegion;
 }
 
 void
+PaymentAddress::GetRegionCode(nsAString& aRetVal) const
+{
+  aRetVal = mRegionCode;
+}
+
+void
 PaymentAddress::GetCity(nsAString& aRetVal) const
 {
   aRetVal = mCity;
 }
 
 void
 PaymentAddress::GetDependentLocality(nsAString& aRetVal) const
 {
--- a/dom/payments/PaymentAddress.h
+++ b/dom/payments/PaymentAddress.h
@@ -19,16 +19,17 @@ class PaymentAddress final : public nsIS
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaymentAddress)
 
   PaymentAddress(nsPIDOMWindowInner* aWindow,
                  const nsAString& aCountry,
                  const nsTArray<nsString>& aAddressLine,
                  const nsAString& aRegion,
+                 const nsAString& aRegionCode,
                  const nsAString& aCity,
                  const nsAString& aDependentLocality,
                  const nsAString& aPostalCode,
                  const nsAString& aSortingCode,
                  const nsAString& aOrganization,
                  const nsAString& aRecipient,
                  const nsAString& aPhone);
 
@@ -42,16 +43,18 @@ public:
 
   // Getter functions
   void GetCountry(nsAString& aRetVal) const;
 
   void GetAddressLine(nsTArray<nsString>& aRetVal) const;
 
   void GetRegion(nsAString& aRetVal) const;
 
+  void GetRegionCode(nsAString& aRetVal) const;
+
   void GetCity(nsAString& aRetVal) const;
 
   void GetDependentLocality(nsAString& aRetVal) const;
 
   void GetPostalCode(nsAString& aRetVal) const;
 
   void GetSortingCode(nsAString& aRetVal) const;
 
@@ -62,16 +65,17 @@ public:
   void GetPhone(nsAString& aRetVal) const;
 
 private:
   ~PaymentAddress();
 
   nsString mCountry;
   nsTArray<nsString> mAddressLine;
   nsString mRegion;
+  nsString mRegionCode;
   nsString mCity;
   nsString mDependentLocality;
   nsString mPostalCode;
   nsString mSortingCode;
   nsString mOrganization;
   nsString mRecipient;
   nsString mPhone;
 
--- a/dom/payments/PaymentRequest.cpp
+++ b/dom/payments/PaymentRequest.cpp
@@ -1035,31 +1035,34 @@ PaymentRequest::GetShippingAddress() con
   RefPtr<PaymentAddress> address = mShippingAddress;
   return address.forget();
 }
 
 nsresult
 PaymentRequest::UpdateShippingAddress(const nsAString& aCountry,
                                       const nsTArray<nsString>& aAddressLine,
                                       const nsAString& aRegion,
+                                      const nsAString& aRegionCode,
                                       const nsAString& aCity,
                                       const nsAString& aDependentLocality,
                                       const nsAString& aPostalCode,
                                       const nsAString& aSortingCode,
                                       const nsAString& aOrganization,
                                       const nsAString& aRecipient,
                                       const nsAString& aPhone)
 {
   nsTArray<nsString> emptyArray;
   mShippingAddress = new PaymentAddress(GetOwner(), aCountry, emptyArray,
-                                        aRegion, aCity, aDependentLocality,
-                                        aPostalCode, aSortingCode,
-                                        EmptyString(), EmptyString(), EmptyString());
+                                        aRegion, aRegionCode, aCity,
+                                        aDependentLocality, aPostalCode,
+                                        aSortingCode, EmptyString(),
+                                        EmptyString(), EmptyString());
   mFullShippingAddress = new PaymentAddress(GetOwner(), aCountry, aAddressLine,
-                                            aRegion, aCity, aDependentLocality,
+                                            aRegion, aRegionCode, aCity,
+                                            aDependentLocality,
                                             aPostalCode, aSortingCode,
                                             aOrganization, aRecipient, aPhone);
   // Fire shippingaddresschange event
   return DispatchUpdateEvent(NS_LITERAL_STRING("shippingaddresschange"));
 }
 
 void
 PaymentRequest::SetShippingOption(const nsAString& aShippingOption)
--- a/dom/payments/PaymentRequest.h
+++ b/dom/payments/PaymentRequest.h
@@ -121,16 +121,17 @@ public:
 
   already_AddRefed<PaymentResponse> GetResponse() const;
 
   already_AddRefed<PaymentAddress> GetShippingAddress() const;
   // Update mShippingAddress and fire shippingaddresschange event
   nsresult UpdateShippingAddress(const nsAString& aCountry,
                                  const nsTArray<nsString>& aAddressLine,
                                  const nsAString& aRegion,
+                                 const nsAString& aRegionCode,
                                  const nsAString& aCity,
                                  const nsAString& aDependentLocality,
                                  const nsAString& aPostalCode,
                                  const nsAString& aSortingCode,
                                  const nsAString& aOrganization,
                                  const nsAString& aRecipient,
                                  const nsAString& aPhone);
 
--- a/dom/payments/PaymentRequestData.cpp
+++ b/dom/payments/PaymentRequestData.cpp
@@ -810,27 +810,29 @@ PaymentRequest::GetCompleteStatus(nsAStr
 /* PaymentAddress */
 
 NS_IMPL_ISUPPORTS(PaymentAddress, nsIPaymentAddress)
 
 NS_IMETHODIMP
 PaymentAddress::Init(const nsAString& aCountry,
                      nsIArray* aAddressLine,
                      const nsAString& aRegion,
+                     const nsAString& aRegionCode,
                      const nsAString& aCity,
                      const nsAString& aDependentLocality,
                      const nsAString& aPostalCode,
                      const nsAString& aSortingCode,
                      const nsAString& aOrganization,
                      const nsAString& aRecipient,
                      const nsAString& aPhone)
 {
   mCountry = aCountry;
   mAddressLine = aAddressLine;
   mRegion = aRegion;
+  mRegionCode = aRegionCode;
   mCity = aCity;
   mDependentLocality = aDependentLocality;
   mPostalCode = aPostalCode;
   mSortingCode = aSortingCode;
   mOrganization = aOrganization;
   mRecipient = aRecipient;
   mPhone = aPhone;
   return NS_OK;
@@ -855,16 +857,23 @@ PaymentAddress::GetAddressLine(nsIArray*
 NS_IMETHODIMP
 PaymentAddress::GetRegion(nsAString& aRegion)
 {
   aRegion = mRegion;
   return NS_OK;
 }
 
 NS_IMETHODIMP
+PaymentAddress::GetRegionCode(nsAString& aRegionCode)
+{
+  aRegionCode = mRegionCode;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 PaymentAddress::GetCity(nsAString& aCity)
 {
   aCity = mCity;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PaymentAddress::GetDependentLocality(nsAString& aDependentLocality)
--- a/dom/payments/PaymentRequestData.h
+++ b/dom/payments/PaymentRequestData.h
@@ -282,16 +282,17 @@ public:
   PaymentAddress() = default;
 
 private:
   ~PaymentAddress() = default;
 
   nsString mCountry;
   nsCOMPtr<nsIArray> mAddressLine;
   nsString mRegion;
+  nsString mRegionCode;
   nsString mCity;
   nsString mDependentLocality;
   nsString mPostalCode;
   nsString mSortingCode;
   nsString mOrganization;
   nsString mRecipient;
   nsString mPhone;
 };
--- a/dom/payments/PaymentRequestManager.cpp
+++ b/dom/payments/PaymentRequestManager.cpp
@@ -647,16 +647,17 @@ PaymentRequestManager::RespondPayment(Pa
 
 nsresult
 PaymentRequestManager::ChangeShippingAddress(PaymentRequest* aRequest,
                                              const IPCPaymentAddress& aAddress)
 {
   return aRequest->UpdateShippingAddress(aAddress.country(),
                                          aAddress.addressLine(),
                                          aAddress.region(),
+                                         aAddress.regionCode(),
                                          aAddress.city(),
                                          aAddress.dependentLocality(),
                                          aAddress.postalCode(),
                                          aAddress.sortingCode(),
                                          aAddress.organization(),
                                          aAddress.recipient(),
                                          aAddress.phone());
 }
--- a/dom/payments/ipc/PPaymentRequest.ipdl
+++ b/dom/payments/ipc/PPaymentRequest.ipdl
@@ -170,16 +170,17 @@ union IPCPaymentActionResponse
   IPCPaymentCompleteActionResponse;
 };
 
 struct IPCPaymentAddress
 {
   nsString country;
   nsString[] addressLine;
   nsString region;
+  nsString regionCode;
   nsString city;
   nsString dependentLocality;
   nsString postalCode;
   nsString sortingCode;
   nsString organization;
   nsString recipient;
   nsString phone;
 };
--- a/dom/payments/ipc/PaymentRequestParent.cpp
+++ b/dom/payments/ipc/PaymentRequestParent.cpp
@@ -216,16 +216,20 @@ PaymentRequestParent::ChangeShippingAddr
   nsCOMPtr<nsIArray> iaddressLine;
   rv = aAddress->GetAddressLine(getter_AddRefs(iaddressLine));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString region;
   rv = aAddress->GetRegion(region);
   NS_ENSURE_SUCCESS(rv, rv);
 
+  nsAutoString regionCode;
+  rv = aAddress->GetRegionCode(regionCode);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   nsAutoString city;
   rv = aAddress->GetCity(city);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString dependentLocality;
   rv = aAddress->GetDependentLocality(dependentLocality);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -257,17 +261,17 @@ PaymentRequestParent::ChangeShippingAddr
     nsCOMPtr<nsISupportsString> iaddress = do_QueryElementAt(iaddressLine, index);
     MOZ_ASSERT(iaddress);
     nsAutoString address;
     rv = iaddress->GetData(address);
     NS_ENSURE_SUCCESS(rv, rv);
     addressLine.AppendElement(address);
   }
 
-  IPCPaymentAddress ipcAddress(country, addressLine, region, city,
+  IPCPaymentAddress ipcAddress(country, addressLine, region, regionCode, city,
                                dependentLocality, postalCode, sortingCode,
                                organization, recipient, phone);
 
   nsAutoString requestId(aRequestId);
   if (!SendChangeShippingAddress(requestId, ipcAddress)) {
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
--- a/dom/payments/test/BasicCardErrorsChromeScript.js
+++ b/dom/payments/test/BasicCardErrorsChromeScript.js
@@ -29,16 +29,17 @@ function makeBillingAddress() {
     Ci.nsISupportsString
   );
   address.data = "Easton Ave";
   addressLine.appendElement(address);
   const addressArgs = [
     "USA", // country
     addressLine, // address line
     "CA", // region
+    "CA", // regionCode
     "San Bruno", // city
     "", // dependent locality
     "94066", // postal code
     "123456", // sorting code
     "", // organization
     "Bill A. Pacheco", // recipient
     "+14344413879", // phone
   ];
--- a/dom/payments/test/BasiccardChromeScript.js
+++ b/dom/payments/test/BasiccardChromeScript.js
@@ -12,19 +12,20 @@ function emitTestFail(message) {
 }
 
 const billingAddress = Cc["@mozilla.org/dom/payments/payment-address;1"].
                            createInstance(Ci.nsIPaymentAddress);
 const addressLine = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
 address.data = "Easton Ave";
 addressLine.appendElement(address);
-billingAddress.init("USA",              // country
+billingAddress.init("USA",               // country
                      addressLine,        // address line
                      "CA",               // region
+                     "CA",               // region code
                      "San Bruno",        // city
                      "",                 // dependent locality
                      "94066",            // postal code
                      "123456",           // sorting code
                      "",                 // organization
                      "Bill A. Pacheco",  // recipient
                      "+14344413879"); // phone
 
--- a/dom/payments/test/Bug1490698ChromeScript.js
+++ b/dom/payments/test/Bug1490698ChromeScript.js
@@ -15,26 +15,27 @@ function emitTestPass(message) {
 }
 
 const billingAddress = Cc["@mozilla.org/dom/payments/payment-address;1"].
                            createInstance(Ci.nsIPaymentAddress);
 const addressLine = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
 address.data = "Easton Ave";
 addressLine.appendElement(address);
-billingAddress.init("USA",              // country
+billingAddress.init("USA",               // country
                      addressLine,        // address line
                      "CA",               // region
+                     "CA",               // region code
                      "San Bruno",        // city
                      "",                 // dependent locality
                      "94066",            // postal code
                      "123456",           // sorting code
                      "",                 // organization
                      "Bill A. Pacheco",  // recipient
-                     "+14344413879"); // phone
+                     "+14344413879");    // phone
 
 function acceptPayment(requestId) {
   const basiccardResponseData = Cc["@mozilla.org/dom/payments/basiccard-response-data;1"].
                                    createInstance(Ci.nsIBasicCardResponseData);
   const showResponse = Cc["@mozilla.org/dom/payments/payment-show-action-response;1"].
                           createInstance(Ci.nsIPaymentShowActionResponse);
   basiccardResponseData.initData("Bill A. Pacheco",  // cardholderName
                                  "4916855166538720", // cardNumber
--- a/dom/payments/test/RequestShippingChromeScript.js
+++ b/dom/payments/test/RequestShippingChromeScript.js
@@ -15,16 +15,17 @@ const shippingAddress = Cc["@mozilla.org
                            createInstance(Ci.nsIPaymentAddress);
 const addressLine = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
 address.data = "Easton Ave";
 addressLine.appendElement(address);
 shippingAddress.init("",  // country
                      addressLine, // address line
                      "",  // region
+                     "",  // region code
                      "",  // city
                      "",  // dependent locality
                      "",  // postal code
                      "",  // sorting code
                      "",  // organization
                      "",  // recipient
                      ""); // phone
 
--- a/dom/payments/test/RetryPaymentChromeScript.js
+++ b/dom/payments/test/RetryPaymentChromeScript.js
@@ -15,26 +15,27 @@ function emitTestPass(message) {
 }
 
 const billingAddress = Cc["@mozilla.org/dom/payments/payment-address;1"].
                            createInstance(Ci.nsIPaymentAddress);
 const addressLine = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
 address.data = "Easton Ave";
 addressLine.appendElement(address);
-billingAddress.init("USA",              // country
+billingAddress.init("USA",               // country
                      addressLine,        // address line
                      "CA",               // region
+                     "CA",               // region code
                      "San Bruno",        // city
                      "",                 // dependent locality
                      "94066",            // postal code
                      "123456",           // sorting code
                      "",                 // organization
                      "Bill A. Pacheco",  // recipient
-                     "+14344413879"); // phone
+                     "+14344413879");    // phone
 
 function acceptPayment(requestId, mode) {
   const basiccardResponseData = Cc["@mozilla.org/dom/payments/basiccard-response-data;1"].
                                    createInstance(Ci.nsIBasicCardResponseData);
   const showResponse = Cc["@mozilla.org/dom/payments/payment-show-action-response;1"].
                           createInstance(Ci.nsIPaymentShowActionResponse);
   basiccardResponseData.initData("Bill A. Pacheco",  // cardholderName
                                  "4916855166538720", // cardNumber
--- a/dom/payments/test/ShowPaymentChromeScript.js
+++ b/dom/payments/test/ShowPaymentChromeScript.js
@@ -21,16 +21,17 @@ const shippingAddress = Cc["@mozilla.org
                            createInstance(Ci.nsIPaymentAddress);
 const addressLine = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
 address.data = "Easton Ave";
 addressLine.appendElement(address);
 shippingAddress.init("USA",              // country
                      addressLine,        // address line
                      "CA",               // region
+                     "CA",               // region code
                      "San Bruno",        // city
                      "Test locality",    // dependent locality
                      "94066",            // postal code
                      "123456",           // sorting code
                      "Testing Org",      // organization
                      "Bill A. Pacheco",  // recipient
                      "+1-434-441-3879"); // phone
 
--- a/dom/payments/test/UpdateErrorsChromeScript.js
+++ b/dom/payments/test/UpdateErrorsChromeScript.js
@@ -18,16 +18,17 @@ const shippingAddress = Cc["@mozilla.org
                            createInstance(Ci.nsIPaymentAddress);
 const addressLine = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 const address = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
 address.data = "Easton Ave";
 addressLine.appendElement(address);
 shippingAddress.init("USA",              // country
                      addressLine,        // address line
                      "CA",               // region
+                     "CA",               // region code
                      "San Bruno",        // city
                      "Test locality",    // dependent locality
                      "94066",            // postal code
                      "123456",           // sorting code
                      "Testing Org",      // organization
                      "Bill A. Pacheco",  // recipient
                      "+1-434-441-3879"); // phone
 
@@ -117,16 +118,20 @@ function checkAddressErrors(errors) {
   if (errors.recipient != "recipient error") {
     emitTestFail("Expect shippingAddressErrors.recipient as 'recipient error', but got" +
                   errors.recipient);
   }
   if (errors.region != "region error") {
     emitTestFail("Expect shippingAddressErrors.region as 'region error', but got" +
                   errors.region);
   }
+  if (errors.regionCode != "regionCode error") {
+    emitTestFail("Expect shippingAddressErrors.regionCode as 'regionCode error', but got" +
+                  errors.region);
+  }
   if (errors.sortingCode != "sortingCode error") {
     emitTestFail("Expect shippingAddressErrors.sortingCode as 'sortingCode error', but got" +
                   errors.sortingCode);
   }
 }
 
 function updateRequest(requestId) {
   let request = paymentSrv.getPaymentRequestById(requestId);
--- a/dom/payments/test/test_basiccard.html
+++ b/dom/payments/test/test_basiccard.html
@@ -215,16 +215,17 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(response.details.expiryMonth, "01", "response.details.expiryMonth should be '01'.");
         is(response.details.expiryYear, "2024", "response.details.expiryYear should be '2024'.");
         is(response.details.cardSecurityCode, "180", "response.details.cardSecurityCode should be '180'.");
         const billingAddress = response.details.billingAddress;
         is(billingAddress.country, "USA", "country should be 'USA'.");
         is(billingAddress.addressLine.length, 1, "addressLine.length should be 1.");
         is(billingAddress.addressLine[0], "Easton Ave", "addressLine[0] should be 'Easton Ave'.");
         is(billingAddress.region, "CA", "region should be 'CA'.");
+        is(billingAddress.regionCode, "CA", "regionCode should be 'CA'.");
         is(billingAddress.city, "San Bruno", "city should be 'San Bruno'.");
         is(billingAddress.dependentLocality, "", "dependentLocality should be empty.");
         is(billingAddress.postalCode, "94066", "postalCode should be '94066'.");
         is(billingAddress.sortingCode, "123456", "sortingCode should be '123456'.");
         is(billingAddress.organization, "", "organization should be empty." );
         is(billingAddress.recipient, "Bill A. Pacheco", "recipient should be 'Bill A. Pacheco'.");
         is(billingAddress.phone, "+14344413879", "phone should be '+14344413879'.");
         response.complete("success").then(() =>{
--- a/dom/security/featurepolicy/FeaturePolicyUtils.cpp
+++ b/dom/security/featurepolicy/FeaturePolicyUtils.cpp
@@ -26,17 +26,16 @@ struct FeatureMap {
  */
 static FeatureMap sSupportedFeatures[] = {
   // TODO: not supported yet!!!
   { "autoplay", FeatureMap::eAll },
   // TODO: not supported yet!!!
   { "camera", FeatureMap::eAll  },
   { "encrypted-media", FeatureMap::eAll  },
   { "fullscreen", FeatureMap::eAll  },
-  // TODO: not supported yet!!!
   { "geolocation", FeatureMap::eAll  },
   // TODO: not supported yet!!!
   { "microphone", FeatureMap::eAll  },
   { "midi", FeatureMap::eAll  },
   { "payment", FeatureMap::eAll  },
   // TODO: not supported yet!!!
   { "speaker", FeatureMap::eAll  },
   { "vr", FeatureMap::eAll  },
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/geolocation/file_featurePolicy.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="geolocation_common.js"></script>
+</head>
+<body>
+<script class="testbody" type="text/javascript">
+
+resume_geolocationProvider(function() {
+  force_prompt(true, test_currentPosition);
+});
+
+let tests = [];
+
+function test_currentPosition() {
+  navigator.geolocation.getCurrentPosition(() => {
+    tests.push("allowed");
+    test_watchPosition();
+  }, () => {
+    tests.push("denied");
+    test_watchPosition();
+  })
+}
+
+function test_watchPosition() {
+  navigator.geolocation.watchPosition(() => {
+    tests.push("allowed");
+    send_results();
+  }, () => {
+    tests.push("denied");
+    send_results();
+  });
+}
+
+function send_results() {
+  if (tests.length != 2 || tests[0] != tests[1]) {
+    parent.continueTest("error");
+    return;
+  }
+
+  parent.continueTest(tests[0]);
+}
+
+</script>
+</body>
+</html>
--- a/dom/tests/mochitest/geolocation/mochitest.ini
+++ b/dom/tests/mochitest/geolocation/mochitest.ini
@@ -24,16 +24,18 @@ support-files = test_geolocation_is_unde
 [test_manyWatchSerial.html]
 [test_manyWindows.html]
 [test_optional_api_params.html]
 [test_shutdown.html]
 [test_timeoutCurrent.html]
 [test_timerRestartWatch.html]
 [test_windowClose.html]
 [test_worseAccuracyDoesNotBlockCallback.html]
+[test_featurePolicy.html]
+support-files = file_featurePolicy.html
 
 # This test REQUIRES to run on HTTP (_NOT_ HTTPS).
 [test_geoWatchPositionBlockedInInsecureContext.html]
 scheme = http
 
 # This test REQUIRES to run on HTTP (_NOT_ HTTPS).
 [test_geoGetCurrentPositionBlockedInInsecureContext.html]
 scheme = http
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/geolocation/test_featurePolicy.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test for geolocation + featurePolicy</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<script class="testbody" type="text/javascript">
+
+SimpleTest.waitForExplicitFinish();
+
+var tests = [
+  [ "geolocation 'none'", "denied"],
+  [ "geolocation", "allowed"],
+  [ "geolocation 'src'", "allowed"],
+  [ "geolocation 'self'", "allowed"],
+  [ "geolocation *", "allowed"],
+  [ "geolocation http://random.net", "denied"],
+  [ null, "allowed" ],
+];
+
+function nextTest() {
+  if (tests.length == 0) {
+    SimpleTest.finish();
+    return;
+  }
+
+  let test = tests.shift();
+
+  var iframe = document.createElement("iframe");
+  if (test[0]) {
+    iframe.setAttribute("allow", test[0]);
+  }
+
+  window.continueTest = msg => {
+    delete window.continueTest;
+
+    is(msg, test[1], "Expected " + test[1] + " for " + test[0]);
+    document.body.removeChild(iframe);
+    SimpleTest.executeSoon(nextTest);
+  };
+
+  iframe.src = "file_featurePolicy.html";
+  document.body.appendChild(iframe);
+}
+
+SpecialPowers.pushPrefEnv({"set": [["dom.security.featurePolicy.enabled", true]]}).then(nextTest);
+</script>
+</body>
+</html>
--- a/dom/webidl/PaymentAddress.webidl
+++ b/dom/webidl/PaymentAddress.webidl
@@ -16,16 +16,17 @@ interface PaymentAddress {
   [Default] object toJSON();
 
   readonly attribute DOMString              country;
   // TODO: Use FrozenArray once available. (Bug 1236777)
   // readonly attribute FrozenArray<DOMString> addressLine;
   [Frozen, Cached, Pure]
   readonly attribute sequence<DOMString>    addressLine;
   readonly attribute DOMString              region;
+  readonly attribute DOMString              regionCode;
   readonly attribute DOMString              city;
   readonly attribute DOMString              dependentLocality;
   readonly attribute DOMString              postalCode;
   readonly attribute DOMString              sortingCode;
   readonly attribute DOMString              organization;
   readonly attribute DOMString              recipient;
   readonly attribute DOMString              phone;
 };
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -85,16 +85,17 @@ struct BlobItemData
   bool mUsed; // initialized near construction
 
   // a weak pointer to the group that owns this item
   // we use this to track whether group for a particular item has changed
   struct DIGroup* mGroup;
 
   // XXX: only used for debugging
   bool mInvalid;
+  bool mInvalidRegion;
   bool mEmpty;
 
   // properties that are used to emulate layer tree invalidation
   Matrix mMatrix; // updated to track the current transform to device space
   Matrix4x4Flagged mTransform; // only used with nsDisplayTransform items to detect transform changes
   float mOpacity; // only used with nsDisplayOpacity items to detect change to opacity
   RefPtr<BasicLayerManager> mLayerManager;
 
@@ -102,16 +103,17 @@ struct BlobItemData
   LayerIntPoint mGroupOffset;
 
   BlobItemData(DIGroup* aGroup, nsDisplayItem *aItem)
     : mUsed(false)
     , mGroup(aGroup)
     , mOpacity(0.0)
   {
     mInvalid = false;
+    mInvalidRegion = false;
     mEmpty = false;
     mDisplayItemKey = aItem->GetPerFrameKey();
     AddFrame(aItem->Frame());
   }
 
 private:
   void AddFrame(nsIFrame* aFrame)
   {
@@ -406,16 +408,17 @@ struct DIGroup
     GP("\n");
     GP("CGC offset %d %d\n", offset.x, offset.y);
     LayerIntSize size = mLayerBounds.Size();
     IntRect imageRect(0, 0, size.width, size.height);
     GP("imageSize: %d %d\n", size.width, size.height);
     /*if (aItem->IsReused() && aData->mGeometry) {
       return;
     }*/
+    aData->mInvalidRegion = false;
 
     GP("pre mInvalidRect: %s %p-%d - inv: %d %d %d %d\n", aItem->Name(), aItem->Frame(), aItem->GetPerFrameKey(),
        mInvalidRect.x, mInvalidRect.y, mInvalidRect.width, mInvalidRect.height);
     if (!aData->mGeometry) {
       // This item is being added for the first time, invalidate its entire area.
       UniquePtr<nsDisplayItemGeometry> geometry(aItem->AllocateGeometry(aBuilder));
       combined = clip.ApplyNonRoundedIntersection(geometry->ComputeInvalidationRegion());
       aData->mGeometry = std::move(geometry);
@@ -484,16 +487,17 @@ struct DIGroup
 
         aData->mGeometry = std::move(geometry);
 
         combined = clip.ApplyNonRoundedIntersection(aData->mGeometry->ComputeInvalidationRegion());
         transformedRect = ToDeviceSpace(combined.GetBounds(), aMatrix, appUnitsPerDevPixel, mLayerBounds.TopLeft());
         aData->mRect = transformedRect.Intersect(imageRect);
 
         aData->mInvalid = true;
+        aData->mInvalidRegion = true;
       } else {
         if (aData->mClip != clip) {
           UniquePtr<nsDisplayItemGeometry> geometry(aItem->AllocateGeometry(aBuilder));
           if (!IsContainerLayerItem(aItem)) {
             // the bounds of layer items can change on us without ComputeInvalidationRegion
             // returning any change. Other items shouldn't have any hidden
             // geometry change.
             MOZ_RELEASE_ASSERT(geometry->mBounds.IsEqualEdges(aData->mGeometry->mBounds));
@@ -738,19 +742,19 @@ struct DIGroup
       } else {
         BlobItemData* data = GetBlobItemData(item);
         if (data->mInvalid) {
           if (item->GetType() == DisplayItemType::TYPE_TRANSFORM) {
             nsDisplayTransform* transformItem = static_cast<nsDisplayTransform*>(item);
             const Matrix4x4Flagged& t = transformItem->GetTransform();
             Matrix t2d;
             bool is2D = t.Is2D(&t2d);
-            gfxCriticalError() << "DisplayItemTransform-" << is2D << "-should-be-invalid";
+            gfxCriticalError() << "DisplayItemTransform-" << is2D << "-region-" << data->mInvalidRegion << "-should-be-invalid";
           } else {
-            gfxCriticalError() << "DisplayItem" << item->Name() << "should be invalid";
+            gfxCriticalError() << "DisplayItem" << item->Name() << "-region-" << data->mInvalidRegion << "-should be invalid";
           }
         }
         // if the item is invalid it needs to be fully contained
         MOZ_RELEASE_ASSERT(!data->mInvalid);
       }
 
       nsDisplayList* children = item->GetChildren();
       if (children) {
--- a/gfx/qcms/fuzztest/qcms_fuzzer.cpp
+++ b/gfx/qcms/fuzztest/qcms_fuzzer.cpp
@@ -34,17 +34,17 @@ transform(qcms_profile* src_profile, qcm
   if (dst_color_space != icSigRgbData) {
     return;
   }
   qcms_data_type dst_type = size & 2 ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
 
   qcms_intent intent = qcms_profile_get_rendering_intent(src_profile);
   // Firefox calls this on the display profile to increase performance.
   // Skip with low probability to increase coverage.
-  if (size % 0x10) {
+  if (size % 15) {
     qcms_profile_precache_output_transform(dst_profile);
   }
 
   qcms_transform* transform =
     qcms_transform_create(src_profile, src_type, dst_profile, dst_type, intent);
   if (!transform) {
     return;
   }
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..12b096cac0ba49f4e6916b72c5b526f8fdb40eb7
GIT binary patch
literal 316
zc${NkV6<TX0u~_7%_}Jia(7bjNla2;Kmv)$#RUv_!MAG+j3D~5E`D`b0h6PVlL3&P
z1H=JNMvfr%8xT9!(FyDhW@fND1$2$crA1{>CL_Z&R6f%UR6b)K(0@*j#G9vurhgKe
Id_MyN0Pmk1@&Et;
--- a/gfx/qcms/iccread.c
+++ b/gfx/qcms/iccread.c
@@ -275,17 +275,17 @@ qcms_bool qcms_profile_is_bogus(qcms_pro
        float rX, rY, rZ, gX, gY, gZ, bX, bY, bZ;
        bool negative;
        unsigned i;
 
        // We currently only check the bogosity of RGB profiles
        if (profile->color_space != RGB_SIGNATURE)
 	       return false;
 
-       if (profile->A2B0 || profile->B2A0)
+       if (profile->A2B0 || profile->B2A0 || profile->mAB || profile->mBA)
                return false;
 
        rX = s15Fixed16Number_to_float(profile->redColorant.X);
        rY = s15Fixed16Number_to_float(profile->redColorant.Y);
        rZ = s15Fixed16Number_to_float(profile->redColorant.Z);
 
        gX = s15Fixed16Number_to_float(profile->greenColorant.X);
        gY = s15Fixed16Number_to_float(profile->greenColorant.Y);
@@ -924,16 +924,17 @@ qcms_profile* qcms_profile_create_rgb_wi
 
 	if (!profile->redTRC || !profile->blueTRC || !profile->greenTRC) {
 		qcms_profile_release(profile);
 		return NO_MEM_PROFILE;
 	}
 	profile->class = DISPLAY_DEVICE_PROFILE;
 	profile->rendering_intent = QCMS_INTENT_PERCEPTUAL;
 	profile->color_space = RGB_SIGNATURE;
+        profile->pcs = XYZ_SIGNATURE;
 	return profile;
 }
 
 qcms_profile* qcms_profile_create_rgb_with_table(
 		qcms_CIE_xyY white_point,
 		qcms_CIE_xyYTRIPLE primaries,
 		uint16_t *table, int num_entries)
 {
@@ -953,16 +954,17 @@ qcms_profile* qcms_profile_create_rgb_wi
 
 	if (!profile->redTRC || !profile->blueTRC || !profile->greenTRC) {
 		qcms_profile_release(profile);
 		return NO_MEM_PROFILE;
 	}
 	profile->class = DISPLAY_DEVICE_PROFILE;
 	profile->rendering_intent = QCMS_INTENT_PERCEPTUAL;
 	profile->color_space = RGB_SIGNATURE;
+        profile->pcs = XYZ_SIGNATURE;
 	return profile;
 }
 
 /* from lcms: cmsWhitePointFromTemp */
 /* tempK must be >= 4000. and <= 25000.
  * Invalid values of tempK will return
  * (x,y,Y) = (-1.0, -1.0, -1.0)
  * similar to argyll: icx_DTEMP2XYZ() */
deleted file mode 100644
--- a/gfx/webrender_bindings/src/bindings.rs.rej
+++ /dev/null
@@ -1,11 +0,0 @@
---- bindings.rs
-+++ bindings.rs
-@@ -1017,7 +1023,7 @@
-         sampler: Some(Box::new(SamplerCallback::new(window_id))),
-         max_texture_size: Some(8192), // Moz2D doesn't like textures bigger than this
-         clear_color: Some(ColorF::new(0.0, 0.0, 0.0, 0.0)),
--        precache_shaders: env_var_to_bool("MOZ_WR_PRECACHE_SHADERS"),
-+        precache_flags,
-         ..Default::default()
-     };
- 
--- a/taskcluster/ci/static-analysis/kind.yml
+++ b/taskcluster/ci/static-analysis/kind.yml
@@ -43,18 +43,18 @@ jobs:
             options: [append-env-variables-from-configs]
             script: mozharness/scripts/fx_desktop_build.py
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win32.py
                 - builds/taskcluster_sub_win32/clang_debug.py
         toolchains:
-            - win32-clang-cl-st-an
-            - win32-rust
+            - win64-clang-cl-st-an
+            - win64-rust
             - win64-cbindgen
             - win64-sccache
             - win64-node
 
     win32-st-an/opt:
         description: "Win32 Static Analysis Opt (clang-cl)"
         index:
             product: firefox
@@ -74,18 +74,18 @@ jobs:
             options: [append-env-variables-from-configs]
             script: mozharness/scripts/fx_desktop_build.py
             config:
                 - builds/releng_base_firefox.py
                 - builds/taskcluster_base_windows.py
                 - builds/taskcluster_base_win32.py
                 - builds/taskcluster_sub_win32/clang.py
         toolchains:
-            - win32-clang-cl-st-an
-            - win32-rust
+            - win64-clang-cl-st-an
+            - win64-rust
             - win64-cbindgen
             - win64-sccache
             - win64-node
 
     win64-st-an/debug:
         description: "Win64 Static Analysis Debug (clang-cl)"
         index:
             product: firefox
--- a/taskcluster/ci/toolchain/windows.yml
+++ b/taskcluster/ci/toolchain/windows.yml
@@ -18,37 +18,16 @@ win64-clang-cl:
         using: toolchain-script
         script: build-clang64-windows.sh
         resources:
             - 'build/build-clang/build-clang.py'
             - 'build/build-clang/clang-win64.json'
             - 'taskcluster/scripts/misc/build-clang-windows-helper64.sh'
         toolchain-artifact: public/build/clang.tar.bz2
 
-win32-clang-cl-st-an:
-    description: "Clang-cl static analysis toolchain build"
-    treeherder:
-        kind: build
-        platform: toolchains/opt
-        symbol: TW32(clang-cl-st-an)
-        tier: 1
-    worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
-    worker:
-        max-run-time: 7200
-        env:
-            TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/win32/build-clang-cl.manifest"
-    run:
-        using: toolchain-script
-        script: build-clang32-st-an-windows.sh
-        resources:
-            - 'build/build-clang/build-clang.py'
-            - 'build/build-clang/clang-win32-st-an.json'
-            - 'taskcluster/scripts/misc/build-clang-windows-helper32.sh'
-        toolchain-artifact: public/build/clang.tar.bz2
-
 win64-clang-cl-st-an:
     description: "Clang-cl static analysis toolchain build"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TW64(clang-cl-st-an)
         tier: 1
     worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
@@ -204,40 +183,16 @@ win64-node:
         docker-image: {in-tree: toolchain-build}
         max-run-time: 1800
     run:
         using: toolchain-script
         script: repack-node.sh
         arguments: ['win64']
         toolchain-artifact: public/build/node.tar.bz2
 
-win32-rust-1.29:
-    description: "rust repack"
-    treeherder:
-        kind: build
-        platform: toolchains/opt
-        symbol: TW32(rust)
-        tier: 1
-    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
-    worker:
-        docker-image: {in-tree: toolchain-build}
-        max-run-time: 7200
-        env:
-            UPLOAD_DIR: artifacts
-    run:
-        using: toolchain-script
-        script: repack_rust.py
-        arguments: [
-            '--channel', '1.29.0',
-            '--host', 'i686-pc-windows-msvc',
-            '--target', 'i686-pc-windows-msvc',
-        ]
-        toolchain-alias: win32-rust
-        toolchain-artifact: public/build/rustc.tar.bz2
-
 mingw32-rust-1.29:
     description: "rust repack"
     treeherder:
         kind: build
         platform: toolchains/opt
         symbol: TMW(rust)
         tier: 1
     worker-type: aws-provisioner-v1/gecko-{level}-b-linux
deleted file mode 100755
--- a/taskcluster/scripts/misc/build-clang32-st-an-windows.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-source build/src/taskcluster/scripts/misc/build-clang-windows-helper32.sh clang-win32-st-an.json
--- a/testing/web-platform/meta/payment-request/idlharness.https.window.js.ini
+++ b/testing/web-platform/meta/payment-request/idlharness.https.window.js.ini
@@ -174,17 +174,18 @@
     expected:
       if not e10s: FAIL
 
   [PaymentAddress interface: attribute region]
     expected:
       if not e10s: FAIL
 
   [PaymentAddress interface: attribute regionCode]
-    expected: FAIL
+    expected:
+      if not e10s: FAIL
 
   [PaymentAddress interface: attribute sortingCode]
     expected:
       if not e10s: FAIL
 
   [PaymentAddress interface: attribute addressLine]
     expected:
       if not e10s: FAIL
--- a/testing/web-platform/meta/payment-request/interfaces.https.html.ini
+++ b/testing/web-platform/meta/payment-request/interfaces.https.html.ini
@@ -435,17 +435,18 @@
     expected: 
       if not e10s: FAIL
 
   [EventTarget interface: calling dispatchEvent(Event) on new PaymentRequest([{supportedMethods: 'foo'}\], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) with too few arguments must throw TypeError]
     expected: 
       if not e10s: FAIL
 
   [PaymentAddress interface: attribute regionCode]
-    expected: FAIL
+    expected:
+      if not e10s: FAIL
 
   [PaymentRequest interface: operation show([object Object\])]
     expected: 
       if not e10s: FAIL
 
   [PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}\], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "show([object Object\])" with the proper type]
     expected: 
       if not e10s: FAIL