Merge mozilla-central to autoland
authorDaniel Varga <dvarga@mozilla.com>
Sat, 08 Sep 2018 01:11:28 +0300
changeset 490982 0e957ded091e36c8af71ec7a175274f550a14b9b
parent 490981 10d5143647cfda21649cf254adcb21d116524c5d (current diff)
parent 490965 3026c40acec365f6606c39234bba5f4e99c83dac (diff)
child 490983 5ce954476a4d9ccd23fbfb1da234e1ed2a4d991d
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)
milestone64.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 mozilla-central to autoland
--- a/dom/audiochannel/AudioChannelAgent.h
+++ b/dom/audiochannel/AudioChannelAgent.h
@@ -7,21 +7,16 @@
 #ifndef mozilla_dom_audio_channel_agent_h__
 #define mozilla_dom_audio_channel_agent_h__
 
 #include "nsIAudioChannelAgent.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsCOMPtr.h"
 #include "nsWeakPtr.h"
 
-#define NS_AUDIOCHANNELAGENT_CONTRACTID "@mozilla.org/audiochannelagent;1"
-// f27688e2-3dd7-11e2-904e-10bf48d64bd4
-#define NS_AUDIOCHANNELAGENT_CID {0xf27688e2, 0x3dd7, 0x11e2, \
-      {0x90, 0x4e, 0x10, 0xbf, 0x48, 0xd6, 0x4b, 0xd4}}
-
 class nsPIDOMWindowInner;
 class nsPIDOMWindowOuter;
 
 namespace mozilla {
 namespace dom {
 
 class AudioPlaybackConfig;
 
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -29,16 +29,17 @@
 #include "nsNetCID.h"
 #include "nsIContent.h"
 #include "nsVersionComparator.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "nsILoadContext.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLObjectElementBinding.h"
+#include "AudioChannelAgent.h"
 #include "AudioChannelService.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 using namespace mozilla;
 using namespace mozilla::plugins::parent;
 using namespace mozilla::layers;
@@ -1236,28 +1237,25 @@ nsNPAPIPluginInstance::GetRunID(uint32_t
 
 nsresult
 nsNPAPIPluginInstance::CreateAudioChannelAgentIfNeeded()
 {
   if (mAudioChannelAgent) {
     return NS_OK;
   }
 
-  nsresult rv;
-  mAudioChannelAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1", &rv);
-  if (NS_WARN_IF(!mAudioChannelAgent)) {
-    return NS_ERROR_FAILURE;
-  }
+  mAudioChannelAgent = new AudioChannelAgent();
 
   nsCOMPtr<nsPIDOMWindowOuter> window = GetDOMWindow();
   if (NS_WARN_IF(!window)) {
     return NS_ERROR_FAILURE;
   }
 
-  rv = mAudioChannelAgent->Init(window->GetCurrentInnerWindow(), this);
+  nsresult rv =
+    mAudioChannelAgent->Init(window->GetCurrentInnerWindow(), this);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return NS_OK;
 }
 
 void
 nsNPAPIPluginInstance::NotifyStartedPlaying()
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -7596,19 +7596,19 @@ ClearRequestBase::DeleteFiles(QuotaManag
   }
 
   OriginScope originScope = mOriginScope.Clone();
   if (originScope.IsOrigin()) {
     nsCString originSanitized(originScope.GetOrigin());
     SanitizeOriginString(originSanitized);
     originScope.SetOrigin(originSanitized);
   } else if (originScope.IsPrefix()) {
-    nsCString prefixSanitized(originScope.GetPrefix());
-    SanitizeOriginString(prefixSanitized);
-    originScope.SetPrefix(prefixSanitized);
+    nsCString originNoSuffixSanitized(originScope.GetOriginNoSuffix());
+    SanitizeOriginString(originNoSuffixSanitized);
+    originScope.SetOriginNoSuffix(originNoSuffixSanitized);
   }
 
   nsCOMPtr<nsIFile> file;
   while (NS_SUCCEEDED((rv = entries->GetNextFile(getter_AddRefs(file)))) && file) {
     bool isDirectory;
     rv = file->IsDirectory(&isDirectory);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return;
@@ -7624,18 +7624,18 @@ ClearRequestBase::DeleteFiles(QuotaManag
       // Unknown files during clearing are allowed. Just warn if we find them.
       if (!IsOSMetadata(leafName)) {
         UNKNOWN_FILE_WARNING(leafName);
       }
       continue;
     }
 
     // Skip the origin directory if it doesn't match the pattern.
-    if (!originScope.MatchesOrigin(OriginScope::FromOrigin(
-                                     NS_ConvertUTF16toUTF8(leafName)))) {
+    if (!originScope.Matches(OriginScope::FromOrigin(
+                               NS_ConvertUTF16toUTF8(leafName)))) {
       continue;
     }
 
     bool persistent = aPersistenceType == PERSISTENCE_TYPE_PERSISTENT;
 
     int64_t timestamp;
     nsCString suffix;
     nsCString group;
--- a/dom/quota/OriginScope.h
+++ b/dom/quota/OriginScope.h
@@ -5,423 +5,483 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_quota_originorpatternstring_h__
 #define mozilla_dom_quota_originorpatternstring_h__
 
 #include "mozilla/dom/quota/QuotaCommon.h"
 
 #include "mozilla/BasePrincipal.h"
+#include "mozilla/Variant.h"
 
 BEGIN_QUOTA_NAMESPACE
 
 class OriginScope
 {
-public:
-  enum Type
-  {
-    eOrigin,
-    ePattern,
-    ePrefix,
-    eNull
-  };
-
-private:
-  struct OriginAndAttributes
+  class Origin
   {
     nsCString mOrigin;
-    OriginAttributes mAttributes;
+    nsCString mOriginNoSuffix;
+    UniquePtr<OriginAttributes> mAttributes;
 
-    OriginAndAttributes(const OriginAndAttributes& aOther)
+  public:
+    explicit Origin(const nsACString& aOrigin)
+      : mOrigin(aOrigin)
+    {
+      InitMembers();
+    }
+
+    Origin(const Origin& aOther)
       : mOrigin(aOther.mOrigin)
-      , mAttributes(aOther.mAttributes)
+      , mOriginNoSuffix(aOther.mOriginNoSuffix)
+      , mAttributes(MakeUnique<OriginAttributes>(*aOther.mAttributes))
+    { }
+
+    Origin(Origin&& aOther) = default;
+
+    const nsACString&
+    GetOrigin() const
     {
-      MOZ_COUNT_CTOR(OriginAndAttributes);
+      return mOrigin;
     }
 
-    explicit OriginAndAttributes(const nsACString& aOrigin)
-      : mOrigin(aOrigin)
+    void
+    SetOrigin(const nsACString& aOrigin)
     {
-      nsCString originNoSuffix;
-      MOZ_ALWAYS_TRUE(mAttributes.PopulateFromOrigin(aOrigin, originNoSuffix));
+      mOrigin = aOrigin;
+
+      InitMembers();
+    }
 
-      MOZ_COUNT_CTOR(OriginAndAttributes);
+    const nsACString&
+    GetOriginNoSuffix() const
+    {
+      return mOriginNoSuffix;
     }
 
-    ~OriginAndAttributes()
+    const OriginAttributes&
+    GetAttributes() const
     {
-      MOZ_COUNT_DTOR(OriginAndAttributes);
+      MOZ_ASSERT(mAttributes);
+
+      return *mAttributes;
+    }
+
+  private:
+    void
+    InitMembers()
+    {
+      mAttributes = MakeUnique<OriginAttributes>();
+
+      MOZ_ALWAYS_TRUE(mAttributes->PopulateFromOrigin(mOrigin,
+                                                      mOriginNoSuffix));
     }
   };
 
-  union {
-    // eOrigin
-    OriginAndAttributes* mOriginAndAttributes;
+  class Prefix
+  {
+    nsCString mOriginNoSuffix;
+
+  public:
+    explicit Prefix(const nsACString& aOriginNoSuffix)
+      : mOriginNoSuffix(aOriginNoSuffix)
+    { }
 
-    // ePattern
-    mozilla::OriginAttributesPattern* mPattern;
+    const nsCString&
+    GetOriginNoSuffix() const
+    {
+      return mOriginNoSuffix;
+    }
 
-    // ePrefix
-    nsCString* mPrefix;
-
-    // eNull
-    void* mDummy;
+    void
+    SetOriginNoSuffix(const nsACString& aOriginNoSuffix)
+    {
+      mOriginNoSuffix = aOriginNoSuffix;
+    }
   };
 
-  Type mType;
+  class Pattern
+  {
+    UniquePtr<OriginAttributesPattern> mPattern;
+
+  public:
+    explicit Pattern(const OriginAttributesPattern& aPattern)
+      : mPattern(MakeUnique<OriginAttributesPattern>(aPattern))
+    { }
+
+    explicit Pattern(const nsAString& aJSONPattern)
+      : mPattern(MakeUnique<OriginAttributesPattern>())
+    {
+      MOZ_ALWAYS_TRUE(mPattern->Init(aJSONPattern));
+    }
+
+    Pattern(const Pattern& aOther)
+      : mPattern(MakeUnique<OriginAttributesPattern>(*aOther.mPattern))
+    { }
+
+    Pattern(Pattern&& aOther) = default;
+
+    const OriginAttributesPattern&
+    GetPattern() const
+    {
+      MOZ_ASSERT(mPattern);
+
+      return *mPattern;
+    }
+
+    void
+    SetPattern(const OriginAttributesPattern& aPattern)
+    {
+      mPattern = MakeUnique<OriginAttributesPattern>(aPattern);
+    }
+
+    nsString
+    GetJSONPattern() const
+    {
+      MOZ_ASSERT(mPattern);
+
+      nsString result;
+      MOZ_ALWAYS_TRUE(mPattern->ToJSON(result));
+
+      return result;
+    }
+  };
+
+  struct Null
+  { };
+
+  using DataType = Variant<Origin, Prefix, Pattern, Null>;
+
+  DataType mData;
 
 public:
+  OriginScope()
+    : mData(Null())
+  { }
+
   static OriginScope
   FromOrigin(const nsACString& aOrigin)
   {
-    return OriginScope(aOrigin, true);
+    return OriginScope(std::move(Origin(aOrigin)));
   }
 
   static OriginScope
-  FromPattern(const mozilla::OriginAttributesPattern& aPattern)
+  FromPrefix(const nsACString& aPrefix)
   {
-    return OriginScope(aPattern);
+    return OriginScope(std::move(Prefix(aPrefix)));
+  }
+
+  static OriginScope
+  FromPattern(const OriginAttributesPattern& aPattern)
+  {
+    return OriginScope(std::move(Pattern(aPattern)));
   }
 
   static OriginScope
   FromJSONPattern(const nsAString& aJSONPattern)
   {
-    return OriginScope(aJSONPattern);
-  }
-
-  static OriginScope
-  FromPrefix(const nsACString& aPrefix)
-  {
-    return OriginScope(aPrefix, false);
+    return OriginScope(std::move(Pattern(aJSONPattern)));
   }
 
   static OriginScope
   FromNull()
   {
-    return OriginScope();
-  }
-
-  OriginScope(const OriginScope& aOther)
-  {
-    if (aOther.IsOrigin()) {
-      mOriginAndAttributes =
-        new OriginAndAttributes(*aOther.mOriginAndAttributes);
-    } else if (aOther.IsPattern()) {
-      mPattern = new mozilla::OriginAttributesPattern(*aOther.mPattern);
-    } else if (aOther.IsPrefix()) {
-      mPrefix = new nsCString(*aOther.mPrefix);
-    } else {
-      mDummy = aOther.mDummy;
-    }
-
-    mType = aOther.mType;
-  }
-
-  ~OriginScope()
-  {
-    Destroy();
+    return OriginScope(std::move(Null()));
   }
 
   bool
   IsOrigin() const
   {
-    return mType == eOrigin;
+    return mData.is<Origin>();
+  }
+
+  bool
+  IsPrefix() const
+  {
+    return mData.is<Prefix>();
   }
 
   bool
   IsPattern() const
   {
-    return mType == ePattern;
-  }
-
-  bool
-  IsPrefix() const
-  {
-    return mType == ePrefix;
+    return mData.is<Pattern>();
   }
 
   bool
   IsNull() const
   {
-    return mType == eNull;
-  }
-
-  Type
-  GetType() const
-  {
-    return mType;
+    return mData.is<Null>();
   }
 
   void
   SetFromOrigin(const nsACString& aOrigin)
   {
-    Destroy();
-
-    mOriginAndAttributes = new OriginAndAttributes(aOrigin);
-
-    mType = eOrigin;
+    mData = AsVariant(Origin(aOrigin));
   }
 
   void
-  SetFromPattern(const mozilla::OriginAttributesPattern& aPattern)
+  SetFromPrefix(const nsACString& aPrefix)
   {
-    Destroy();
+    mData = AsVariant(Prefix(aPrefix));
+  }
 
-    mPattern = new mozilla::OriginAttributesPattern(aPattern);
-
-    mType = ePattern;
+  void
+  SetFromPattern(const OriginAttributesPattern& aPattern)
+  {
+    mData = AsVariant(Pattern(aPattern));
   }
 
   void
   SetFromJSONPattern(const nsAString& aJSONPattern)
   {
-    Destroy();
-
-    mPattern = new mozilla::OriginAttributesPattern();
-    MOZ_ALWAYS_TRUE(mPattern->Init(aJSONPattern));
-
-    mType = ePattern;
-  }
-
-  void
-  SetFromPrefix(const nsACString& aPrefix)
-  {
-    Destroy();
-
-    mPrefix = new nsCString(aPrefix);
-
-    mType = ePrefix;
+    mData = AsVariant(Pattern(aJSONPattern));
   }
 
   void
   SetFromNull()
   {
-    Destroy();
-
-    mDummy = nullptr;
-
-    mType = eNull;
+    mData = AsVariant(Null());
   }
 
   const nsACString&
   GetOrigin() const
   {
     MOZ_ASSERT(IsOrigin());
-    MOZ_ASSERT(mOriginAndAttributes);
 
-    return mOriginAndAttributes->mOrigin;
+    return mData.as<Origin>().GetOrigin();
   }
 
   void
   SetOrigin(const nsACString& aOrigin)
   {
     MOZ_ASSERT(IsOrigin());
-    MOZ_ASSERT(mOriginAndAttributes);
-    mOriginAndAttributes->mOrigin = aOrigin;
+
+    mData.as<Origin>().SetOrigin(aOrigin);
   }
 
-  const mozilla::OriginAttributes&
-  GetOriginAttributes() const
+  const nsACString&
+  GetOriginNoSuffix() const
   {
-    MOZ_ASSERT(IsOrigin());
-    MOZ_ASSERT(mOriginAndAttributes);
-    return mOriginAndAttributes->mAttributes;
+    MOZ_ASSERT(IsOrigin() || IsPrefix());
+
+    if (IsOrigin()) {
+      return mData.as<Origin>().GetOriginNoSuffix();
+    }
+    return mData.as<Prefix>().GetOriginNoSuffix();
   }
 
-  const mozilla::OriginAttributesPattern&
+  void
+  SetOriginNoSuffix(const nsACString& aOriginNoSuffix)
+  {
+    MOZ_ASSERT(IsPrefix());
+
+    mData.as<Prefix>().SetOriginNoSuffix(aOriginNoSuffix);
+  }
+
+  const OriginAttributesPattern&
   GetPattern() const
   {
     MOZ_ASSERT(IsPattern());
-    MOZ_ASSERT(mPattern);
-    return *mPattern;
+
+    return mData.as<Pattern>().GetPattern();
   }
 
-  const nsACString&
-  GetPrefix() const
+  nsString
+  GetJSONPattern() const
   {
-    MOZ_ASSERT(IsPrefix());
-    MOZ_ASSERT(mPrefix);
+    MOZ_ASSERT(IsPattern());
 
-    return *mPrefix;
+    return mData.as<Pattern>().GetJSONPattern();
   }
 
   void
-  SetPrefix(const nsACString& aPrefix)
+  SetPattern(const OriginAttributesPattern& aPattern)
   {
-    MOZ_ASSERT(IsPrefix());
-    MOZ_ASSERT(mPrefix);
-
-    *mPrefix = aPrefix;
-  }
-
-  bool MatchesOrigin(const OriginScope& aOther) const
-  {
-    MOZ_ASSERT(aOther.IsOrigin());
-    MOZ_ASSERT(aOther.mOriginAndAttributes);
-
-    bool match;
+    MOZ_ASSERT(IsPattern());
 
-    if (IsOrigin()) {
-      MOZ_ASSERT(mOriginAndAttributes);
-      match = mOriginAndAttributes->mOrigin.Equals(
-                aOther.mOriginAndAttributes->mOrigin);
-    } else if (IsPattern()) {
-      MOZ_ASSERT(mPattern);
-      match = mPattern->Matches(aOther.mOriginAndAttributes->mAttributes);
-    } else if (IsPrefix()) {
-      MOZ_ASSERT(mPrefix);
-      match = StringBeginsWith(aOther.mOriginAndAttributes->mOrigin, *mPrefix);
-    } else {
-      match = true;
-    }
-
-    return match;
+    mData.as<Pattern>().SetPattern(aPattern);
   }
 
-  bool MatchesPattern(const OriginScope& aOther) const
+  bool
+  Matches(const OriginScope& aOther) const
   {
-    MOZ_ASSERT(aOther.IsPattern());
-    MOZ_ASSERT(aOther.mPattern);
-
-    bool match;
+    struct Matcher
+    {
+      const OriginScope& mThis;
 
-    if (IsOrigin()) {
-      MOZ_ASSERT(mOriginAndAttributes);
-      match = aOther.mPattern->Matches(mOriginAndAttributes->mAttributes);
-    } else if (IsPattern()) {
-      MOZ_ASSERT(mPattern);
-      match = mPattern->Overlaps(*aOther.mPattern);
-    } else if (IsPrefix()) {
-      MOZ_ASSERT(mPrefix);
-      // The match will be always true here because any origin attributes
-      // pattern overlaps any origin prefix (an origin prefix targets all
-      // origin attributes).
-      match = true;
-    } else {
-      match = true;
-    }
+      explicit Matcher(const OriginScope& aThis)
+        : mThis(aThis)
+      { }
 
-    return match;
-  }
-
-  bool MatchesPrefix(const OriginScope& aOther) const
-  {
-    MOZ_ASSERT(aOther.IsPrefix());
-    MOZ_ASSERT(aOther.mPrefix);
-
-    bool match;
+      bool
+      match(const Origin& aOther) {
+        return mThis.MatchesOrigin(aOther);
+      }
 
-    if (IsOrigin()) {
-      MOZ_ASSERT(mOriginAndAttributes);
-      match = StringBeginsWith(mOriginAndAttributes->mOrigin, *aOther.mPrefix);
-    } else if (IsPattern()) {
-      MOZ_ASSERT(mPattern);
-      // The match will be always true here because any origin attributes
-      // pattern overlaps any origin prefix (an origin prefix targets all
-      // origin attributes).
-      match = true;
-    } else if (IsPrefix()) {
-      MOZ_ASSERT(mPrefix);
-      match = mPrefix->Equals(*aOther.mPrefix);
-    } else {
-      match = true;
-    }
+      bool
+      match(const Prefix& aOther) {
+        return mThis.MatchesPrefix(aOther);
+      }
 
-    return match;
-  }
-
-  bool Matches(const OriginScope& aOther) const
-  {
-    bool match;
+      bool
+      match(const Pattern& aOther) {
+        return mThis.MatchesPattern(aOther);
+      }
 
-    if (aOther.IsOrigin()) {
-      match = MatchesOrigin(aOther);
-    } else if (aOther.IsPattern()) {
-      match = MatchesPattern(aOther);
-    } else if (aOther.IsPrefix()) {
-      match = MatchesPrefix(aOther);
-    } else {
-      match = true;
-    }
+      bool
+      match(const Null& aOther) {
+        return true;
+      }
+    };
 
-    return match;
+    return aOther.mData.match(Matcher(*this));
   }
 
   OriginScope
   Clone()
   {
-    if (IsOrigin()) {
-      MOZ_ASSERT(mOriginAndAttributes);
-      return OriginScope(*mOriginAndAttributes);
-    }
-
-    if (IsPattern()) {
-      MOZ_ASSERT(mPattern);
-      return OriginScope(*mPattern);
-    }
-
-    if (IsPrefix()) {
-      MOZ_ASSERT(mPrefix);
-      return OriginScope(*mPrefix, false);
-    }
-
-    MOZ_ASSERT(IsNull());
-    return OriginScope();
+    return OriginScope(mData);
   }
 
 private:
-  explicit OriginScope(const OriginAndAttributes& aOriginAndAttributes)
-    : mOriginAndAttributes(new OriginAndAttributes(aOriginAndAttributes))
-    , mType(eOrigin)
+  // Move constructors
+  explicit OriginScope(const Origin&& aOrigin)
+    : mData(aOrigin)
+  { }
+
+  explicit OriginScope(const Prefix&& aPrefix)
+    : mData(aPrefix)
   { }
 
-  explicit OriginScope(const nsACString& aOriginOrPrefix, bool aOrigin)
-  {
-    if (aOrigin) {
-      mOriginAndAttributes = new OriginAndAttributes(aOriginOrPrefix);
-      mType = eOrigin;
-    } else {
-      mPrefix = new nsCString(aOriginOrPrefix);
-      mType = ePrefix;
-    }
-  }
+  explicit OriginScope(const Pattern&& aPattern)
+    : mData(aPattern)
+  { }
 
-  explicit OriginScope(const mozilla::OriginAttributesPattern& aPattern)
-    : mPattern(new mozilla::OriginAttributesPattern(aPattern))
-    , mType(ePattern)
+  explicit OriginScope(const Null&& aNull)
+    : mData(aNull)
+  { }
+
+  // Copy constructor
+  explicit OriginScope(const DataType& aOther)
+    : mData(aOther)
   { }
 
-  explicit OriginScope(const nsAString& aJSONPattern)
-    : mPattern(new mozilla::OriginAttributesPattern())
-    , mType(ePattern)
+  bool
+  MatchesOrigin(const Origin& aOther) const
   {
-    MOZ_ALWAYS_TRUE(mPattern->Init(aJSONPattern));
+    struct OriginMatcher
+    {
+      const Origin& mOther;
+
+      explicit OriginMatcher(const Origin& aOther)
+        : mOther(aOther)
+      { }
+
+      bool
+      match(const Origin& aThis) {
+        return aThis.GetOrigin().Equals(mOther.GetOrigin());
+      }
+
+      bool
+      match(const Prefix& aThis) {
+        return aThis.GetOriginNoSuffix().Equals(mOther.GetOriginNoSuffix());
+      }
+
+      bool
+      match(const Pattern& aThis) {
+        return aThis.GetPattern().Matches(mOther.GetAttributes());
+      }
+
+      bool
+      match(const Null& aThis) {
+        // Null covers everything.
+        return true;
+      }
+    };
+
+    return mData.match(OriginMatcher(aOther));
   }
 
-  OriginScope()
-    : mDummy(nullptr)
-    , mType(eNull)
-  { }
-
-  void
-  Destroy()
+  bool
+  MatchesPrefix(const Prefix& aOther) const
   {
-    if (IsOrigin()) {
-      MOZ_ASSERT(mOriginAndAttributes);
-      delete mOriginAndAttributes;
-      mOriginAndAttributes = nullptr;
-    } else if (IsPattern()) {
-      MOZ_ASSERT(mPattern);
-      delete mPattern;
-      mPattern = nullptr;
-    } else if (IsPrefix()) {
-      MOZ_ASSERT(mPrefix);
-      delete mPrefix;
-      mPrefix = nullptr;
-    }
+    struct PrefixMatcher
+    {
+      const Prefix& mOther;
+
+      explicit PrefixMatcher(const Prefix& aOther)
+        : mOther(aOther)
+      { }
+
+      bool
+      match(const Origin& aThis) {
+        return aThis.GetOriginNoSuffix().Equals(mOther.GetOriginNoSuffix());
+      }
+
+      bool
+      match(const Prefix& aThis) {
+        return aThis.GetOriginNoSuffix().Equals(mOther.GetOriginNoSuffix());
+      }
+
+      bool
+      match(const Pattern& aThis) {
+        // The match will be always true here because any origin attributes
+        // pattern overlaps any origin prefix (an origin prefix targets all
+        // origin attributes).
+        return true;
+      }
+
+      bool
+      match(const Null& aThis) {
+        // Null covers everything.
+        return true;
+      }
+    };
+
+    return mData.match(PrefixMatcher(aOther));
+  }
+
+  bool
+  MatchesPattern(const Pattern& aOther) const
+  {
+    struct PatternMatcher
+    {
+      const Pattern& mOther;
+
+      explicit PatternMatcher(const Pattern& aOther)
+        : mOther(aOther)
+      { }
+
+      bool
+      match(const Origin& aThis) {
+        return mOther.GetPattern().Matches(aThis.GetAttributes());
+      }
+
+      bool
+      match(const Prefix& aThis) {
+        // The match will be always true here because any origin attributes
+        // pattern overlaps any origin prefix (an origin prefix targets all
+        // origin attributes).
+        return true;
+      }
+
+      bool
+      match(const Pattern& aThis) {
+        return aThis.GetPattern().Overlaps(mOther.GetPattern());
+      }
+
+      bool
+      match(const Null& aThis) {
+        // Null covers everything.
+        return true;
+      }
+    };
+
+    PatternMatcher patternMatcher(aOther);
+    return mData.match(PatternMatcher(aOther));
   }
 
   bool
   operator==(const OriginScope& aOther) = delete;
 };
 
 END_QUOTA_NAMESPACE
 
--- a/dom/quota/moz.build
+++ b/dom/quota/moz.build
@@ -14,16 +14,18 @@ BROWSER_CHROME_MANIFESTS += ['test/brows
 XPCSHELL_TESTS_MANIFESTS += [
     'test/unit/xpcshell.ini'
 ]
 
 TEST_HARNESS_FILES.xpcshell.dom.quota.test += [
     'test/head-shared.js',
 ]
 
+TEST_DIRS += ['test/gtest']
+
 XPIDL_SOURCES += [
     'nsIQuotaCallbacks.idl',
     'nsIQuotaManagerService.idl',
     'nsIQuotaRequests.idl',
     'nsIQuotaResults.idl',
 ]
 
 XPIDL_MODULE = 'dom_quota'
@@ -62,14 +64,15 @@ IPDL_SOURCES += [
     'PQuota.ipdl',
     'PQuotaRequest.ipdl',
     'PQuotaUsageRequest.ipdl',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
 LOCAL_INCLUDES += [
     '/caps',
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
new file mode 100644
--- /dev/null
+++ b/dom/quota/test/gtest/TestQuotaManager.cpp
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "gtest/gtest.h"
+#include "mozilla/dom/quota/OriginScope.h"
+
+using namespace mozilla;
+using namespace mozilla::dom::quota;
+
+namespace {
+
+struct OriginTest {
+  const char* mOrigin;
+  bool mMatch;
+};
+
+void
+CheckOriginScopeMatchesOrigin(const OriginScope& aOriginScope,
+                              const char* aOrigin,
+                              bool aMatch)
+{
+  bool result =
+    aOriginScope.Matches(OriginScope::FromOrigin(nsDependentCString(aOrigin)));
+
+  EXPECT_TRUE(result == aMatch);
+}
+
+} // namespace
+
+TEST(QuotaManager, OriginScope)
+{
+  OriginScope originScope;
+
+  // Sanity checks.
+
+  {
+    NS_NAMED_LITERAL_CSTRING(origin, "http://www.mozilla.org");
+    originScope.SetFromOrigin(origin);
+    EXPECT_TRUE(originScope.IsOrigin());
+    EXPECT_TRUE(originScope.GetOrigin().Equals(origin));
+    EXPECT_TRUE(originScope.GetOriginNoSuffix().Equals(origin));
+  }
+
+  {
+    NS_NAMED_LITERAL_CSTRING(prefix, "http://www.mozilla.org");
+    originScope.SetFromPrefix(prefix);
+    EXPECT_TRUE(originScope.IsPrefix());
+    EXPECT_TRUE(originScope.GetOriginNoSuffix().Equals(prefix));
+  }
+
+  {
+    NS_NAMED_LITERAL_STRING(pattern, "{\"appId\":1007}");
+    originScope.SetFromJSONPattern(pattern);
+    EXPECT_TRUE(originScope.IsPattern());
+    EXPECT_TRUE(originScope.GetJSONPattern().Equals(pattern));
+  }
+
+  {
+    originScope.SetFromNull();
+    EXPECT_TRUE(originScope.IsNull());
+  }
+
+  // Test each origin scope type against particular origins.
+
+  {
+    originScope.SetFromOrigin(NS_LITERAL_CSTRING("http://www.mozilla.org"));
+
+    static const OriginTest tests[] = {
+      { "http://www.mozilla.org", true },
+      { "http://www.example.org", false },
+    };
+
+    for (const auto& test : tests) {
+      CheckOriginScopeMatchesOrigin(originScope, test.mOrigin, test.mMatch);
+    }
+  }
+
+  {
+    originScope.SetFromPrefix(NS_LITERAL_CSTRING("http://www.mozilla.org"));
+
+    static const OriginTest tests[] = {
+      { "http://www.mozilla.org", true },
+      { "http://www.mozilla.org^userContextId=1", true },
+      { "http://www.example.org^userContextId=1", false },
+    };
+
+    for (const auto& test : tests) {
+      CheckOriginScopeMatchesOrigin(originScope, test.mOrigin, test.mMatch);
+    }
+  }
+
+  {
+    originScope.SetFromJSONPattern(NS_LITERAL_STRING("{\"appId\":1007}"));
+
+    static const OriginTest tests[] = {
+      { "http+++www.mozilla.org^appId=1007", true },
+      { "http+++www.example.org^appId=1007", true },
+      { "http+++www.example.org^appId=1008", false },
+    };
+
+    for (const auto& test : tests) {
+      CheckOriginScopeMatchesOrigin(originScope, test.mOrigin, test.mMatch);
+    }
+  }
+
+  {
+    originScope.SetFromNull();
+
+    static const OriginTest tests[] = {
+      { "http://www.mozilla.org", true },
+      { "http://www.mozilla.org^userContextId=1", true },
+      { "http://www.example.org^userContextId=1", true },
+      { "http+++www.mozilla.org^appId=1007", true },
+      { "http+++www.example.org^appId=1007", true },
+      { "http+++www.example.org^appId=1008", true },
+    };
+
+    for (const auto& test : tests) {
+      CheckOriginScopeMatchesOrigin(originScope, test.mOrigin, test.mMatch);
+    }
+  }
+}
new file mode 100644
--- /dev/null
+++ b/dom/quota/test/gtest/moz.build
@@ -0,0 +1,17 @@
+# -*- Mode: python; 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/.
+
+UNIFIED_SOURCES = [
+    'TestQuotaManager.cpp',
+]
+
+include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'xul-gtest'
+
+LOCAL_INCLUDES += [
+    '/dom/quota',
+]
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -594,16 +594,19 @@ class NodeBuilder
     MOZ_MUST_USE bool thisExpression(TokenPos* pos, MutableHandleValue dst);
 
     MOZ_MUST_USE bool yieldExpression(HandleValue arg, YieldKind kind, TokenPos* pos,
                                       MutableHandleValue dst);
 
     MOZ_MUST_USE bool metaProperty(HandleValue meta, HandleValue property, TokenPos* pos,
                                    MutableHandleValue dst);
 
+    MOZ_MUST_USE bool callImportExpression(HandleValue ident, HandleValue arg, TokenPos* pos,
+                                           MutableHandleValue dst);
+
     MOZ_MUST_USE bool super(TokenPos* pos, MutableHandleValue dst);
 
     /*
      * declarations
      */
 
     MOZ_MUST_USE bool variableDeclaration(NodeVector& elts, VarDeclKind kind, TokenPos* pos,
                                           MutableHandleValue dst);
@@ -1595,16 +1598,30 @@ NodeBuilder::metaProperty(HandleValue me
 
     return newNode(AST_METAPROPERTY, pos,
                    "meta", meta,
                    "property", property,
                    dst);
 }
 
 bool
+NodeBuilder::callImportExpression(HandleValue ident, HandleValue arg, TokenPos* pos,
+                                  MutableHandleValue dst)
+{
+    RootedValue cb(cx, callbacks[AST_CALL_IMPORT]);
+    if (!cb.isNull())
+        return callback(cb, arg, pos, dst);
+
+    return newNode(AST_CALL_IMPORT, pos,
+                   "ident", ident,
+                   "arg", arg,
+                   dst);
+}
+
+bool
 NodeBuilder::super(TokenPos* pos, MutableHandleValue dst)
 {
     RootedValue cb(cx, callbacks[AST_SUPER]);
     if (!cb.isNull())
         return callback(cb, pos, dst);
 
     return newNode(AST_SUPER, pos, dst);
 }
@@ -2945,16 +2962,31 @@ ASTSerializer::expression(ParseNode* pn,
             secondStr = cx->names().meta;
         }
 
         return identifier(firstStr, &pn->pn_left->pn_pos, &firstIdent) &&
                identifier(secondStr, &pn->pn_right->pn_pos, &secondIdent) &&
                builder.metaProperty(firstIdent, secondIdent, &pn->pn_pos, dst);
       }
 
+      case ParseNodeKind::CallImport:
+      {
+        MOZ_ASSERT(pn->pn_left->isKind(ParseNodeKind::PosHolder));
+        MOZ_ASSERT(pn->pn_pos.encloses(pn->pn_left->pn_pos));
+        MOZ_ASSERT(pn->pn_pos.encloses(pn->pn_right->pn_pos));
+
+        RootedValue ident(cx);
+        RootedValue arg(cx);
+
+        HandlePropertyName name = cx->names().import;
+        return identifier(name, &pn->pn_left->pn_pos, &ident) &&
+               expression(pn->pn_right, &arg) &&
+               builder.callImportExpression(ident, arg, &pn->pn_pos, dst);
+      }
+
       case ParseNodeKind::SetThis:
         // SETTHIS is used to assign the result of a super() call to |this|.
         // It's not part of the original AST, so just forward to the call.
         MOZ_ASSERT(pn->pn_left->isKind(ParseNodeKind::Name));
         return expression(pn->pn_right, dst);
 
       default:
         LOCAL_NOT_REACHED("unexpected expression type");
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -1212,16 +1212,21 @@ BytecodeEmitter::checkSideEffects(ParseN
         return true;
 
       // Likewise.
       case ParseNodeKind::Export:
         MOZ_ASSERT(pn->isArity(PN_UNARY));
         *answer = true;
         return true;
 
+      case ParseNodeKind::CallImport:
+        MOZ_ASSERT(pn->isArity(PN_BINARY));
+        *answer = true;
+        return true;
+
       // Every part of a loop might be effect-free, but looping infinitely *is*
       // an effect.  (Language lawyer trivia: C++ says threads can be assumed
       // to exit or have side effects, C++14 [intro.multithread]p27, so a C++
       // implementation's equivalent of the below could set |*answer = false;|
       // if all loop sub-nodes set |*answer = false|!)
       case ParseNodeKind::DoWhile:
       case ParseNodeKind::While:
       case ParseNodeKind::For:
@@ -8303,16 +8308,20 @@ BytecodeEmitter::emitTree(ParseNode* pn,
             return false;
         break;
 
       case ParseNodeKind::ImportMeta:
         if (!emit1(JSOP_IMPORTMETA))
             return false;
         break;
 
+      case ParseNodeKind::CallImport:
+        reportError(nullptr, JSMSG_NO_DYNAMIC_IMPORT);
+        return false;
+
       case ParseNodeKind::SetThis:
         if (!emitSetThis(pn))
             return false;
         break;
 
       case ParseNodeKind::PropertyName:
       case ParseNodeKind::PosHolder:
         MOZ_FALLTHROUGH_ASSERT("Should never try to emit ParseNodeKind::PosHolder or ::Property");
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -131,16 +131,17 @@ ContainsHoistedDeclaration(JSContext* cx
       case ParseNodeKind::ImportSpecList:
       case ParseNodeKind::ImportSpec:
       case ParseNodeKind::ExportFrom:
       case ParseNodeKind::ExportDefault:
       case ParseNodeKind::ExportSpecList:
       case ParseNodeKind::ExportSpec:
       case ParseNodeKind::Export:
       case ParseNodeKind::ExportBatchSpec:
+      case ParseNodeKind::CallImport:
         *result = false;
         return true;
 
       // Statements possibly containing hoistable declarations only in the left
       // half, in ParseNode terms -- the loop body in AST terms.
       case ParseNodeKind::DoWhile:
         return ContainsHoistedDeclaration(cx, node->pn_left, result);
 
@@ -1750,16 +1751,21 @@ Fold(JSContext* cx, ParseNode** pnp, Per
 
       case ParseNodeKind::NewTarget:
       case ParseNodeKind::ImportMeta:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         MOZ_ASSERT(pn->pn_left->isKind(ParseNodeKind::PosHolder));
         MOZ_ASSERT(pn->pn_right->isKind(ParseNodeKind::PosHolder));
         return true;
 
+      case ParseNodeKind::CallImport:
+        MOZ_ASSERT(pn->isArity(PN_BINARY));
+        MOZ_ASSERT(pn->pn_left->isKind(ParseNodeKind::PosHolder));
+        return Fold(cx, &pn->pn_right, parser);
+
       case ParseNodeKind::ClassNames:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         if (ParseNode*& outerBinding = pn->pn_left) {
             if (!Fold(cx, &outerBinding, parser))
                 return false;
         }
         return Fold(cx, &pn->pn_right, parser);
 
--- a/js/src/frontend/FullParseHandler.h
+++ b/js/src/frontend/FullParseHandler.h
@@ -557,16 +557,20 @@ class FullParseHandler
     ParseNode* newExportBatchSpec(const TokenPos& pos) {
         return new_<NullaryNode>(ParseNodeKind::ExportBatchSpec, JSOP_NOP, pos);
     }
 
     ParseNode* newImportMeta(ParseNode* importHolder, ParseNode* metaHolder) {
         return new_<BinaryNode>(ParseNodeKind::ImportMeta, JSOP_NOP, importHolder, metaHolder);
     }
 
+    ParseNode* newCallImport(ParseNode* importHolder, ParseNode* singleArg) {
+        return new_<BinaryNode>(ParseNodeKind::CallImport, JSOP_NOP, importHolder, singleArg);
+    }
+
     ParseNode* newExprStatement(ParseNode* expr, uint32_t end) {
         MOZ_ASSERT(expr->pn_pos.end <= end);
         return new_<UnaryNode>(ParseNodeKind::ExpressionStatement,
                                TokenPos(expr->pn_pos.begin, end), expr);
     }
 
     ParseNode* newIfStatement(uint32_t begin, ParseNode* cond, ParseNode* thenBranch,
                               ParseNode* elseBranch)
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -781,16 +781,22 @@ class NameResolver
                 MOZ_ASSERT(!item->pn_left->expr());
                 MOZ_ASSERT(item->pn_right->isKind(ParseNodeKind::Name));
                 MOZ_ASSERT(!item->pn_right->expr());
             }
 #endif
             break;
           }
 
+          case ParseNodeKind::CallImport:
+            MOZ_ASSERT(cur->isArity(PN_BINARY));
+            if (!resolve(cur->pn_right, prefix))
+                return false;
+            break;
+
           case ParseNodeKind::Dot:
             MOZ_ASSERT(cur->isArity(PN_BINARY));
 
             // Super prop nodes do not have a meaningful LHS
             if (cur->as<PropertyAccess>().isSuper())
                 break;
             if (!resolve(cur->pn_left, prefix))
                 return false;
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -131,16 +131,17 @@ class ObjectBox;
     F(ClassMethodList) \
     F(ClassNames) \
     F(NewTarget) \
     F(PosHolder) \
     F(SuperBase) \
     F(SuperCall) \
     F(SetThis) \
     F(ImportMeta) \
+    F(CallImport) \
     \
     /* Unary operators. */ \
     F(TypeOfName) \
     F(TypeOfExpr) \
     F(Void) \
     F(Not) \
     F(BitNot) \
     F(Await) \
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -5437,25 +5437,25 @@ template <class ParseHandler, typename C
 inline typename ParseHandler::Node
 GeneralParser<ParseHandler, CharT>::importDeclaration()
 {
     return asFinalParser()->importDeclaration();
 }
 
 template <class ParseHandler, typename CharT>
 inline typename ParseHandler::Node
-GeneralParser<ParseHandler, CharT>::importDeclarationOrImportMeta(YieldHandling yieldHandling)
+GeneralParser<ParseHandler, CharT>::importDeclarationOrImportExpr(YieldHandling yieldHandling)
 {
     MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Import));
 
     TokenKind tt;
     if (!tokenStream.peekToken(&tt))
         return null();
 
-    if (tt == TokenKind::Dot)
+    if (tt == TokenKind::Dot || tt == TokenKind::LeftParen)
         return expressionStatement(yieldHandling);
 
     return importDeclaration();
 }
 
 template<typename CharT>
 bool
 Parser<FullParseHandler, CharT>::checkExportedName(JSAtom* exportName)
@@ -7806,17 +7806,17 @@ GeneralParser<ParseHandler, CharT>::stat
 
       // |class| is also forbidden by lookahead restriction.
       case TokenKind::Class:
         error(JSMSG_FORBIDDEN_AS_STATEMENT, "classes");
         return null();
 
       // ImportDeclaration (only inside modules)
       case TokenKind::Import:
-        return importDeclarationOrImportMeta(yieldHandling);
+        return importDeclarationOrImportExpr(yieldHandling);
 
       // ExportDeclaration (only inside modules)
       case TokenKind::Export:
         return exportDeclaration();
 
       // Miscellaneous error cases arguably better caught here than elsewhere.
 
       case TokenKind::Catch:
@@ -7999,17 +7999,17 @@ GeneralParser<ParseHandler, CharT>::stat
       //     LetOrConst BindingList[?In, ?Yield]
       case TokenKind::Const:
         // [In] is the default behavior, because for-loops specially parse
         // their heads to handle |in| in this situation.
         return lexicalDeclaration(yieldHandling, DeclarationKind::Const);
 
       // ImportDeclaration (only inside modules)
       case TokenKind::Import:
-        return importDeclarationOrImportMeta(yieldHandling);
+        return importDeclarationOrImportExpr(yieldHandling);
 
       // ExportDeclaration (only inside modules)
       case TokenKind::Export:
         return exportDeclaration();
 
       // Miscellaneous error cases arguably better caught here than elsewhere.
 
       case TokenKind::Catch:
@@ -8836,17 +8836,17 @@ GeneralParser<ParseHandler, CharT>::memb
     } else if (tt == TokenKind::Super) {
         Node thisName = newThisName();
         if (!thisName)
             return null();
         lhs = handler.newSuperBase(thisName, pos());
         if (!lhs)
             return null();
     } else if (tt == TokenKind::Import) {
-        lhs = importMeta();
+        lhs = importExpr(yieldHandling);
         if (!lhs)
             return null();
     } else {
         lhs = primaryExpr(yieldHandling, tripledotHandling, tt, possibleError, invoked);
         if (!lhs)
             return null();
     }
 
@@ -10019,51 +10019,58 @@ GeneralParser<ParseHandler, CharT>::tryN
         return false;
 
     newTarget = handler.newNewTarget(newHolder, targetHolder);
     return !!newTarget;
 }
 
 template <class ParseHandler, typename CharT>
 typename ParseHandler::Node
-GeneralParser<ParseHandler, CharT>::importMeta()
+GeneralParser<ParseHandler, CharT>::importExpr(YieldHandling yieldHandling)
 {
     MOZ_ASSERT(anyChars.isCurrentTokenType(TokenKind::Import));
 
-    uint32_t begin = pos().begin;
-
-    if (parseGoal() != ParseGoal::Module) {
-        errorAt(begin, JSMSG_IMPORT_OUTSIDE_MODULE);
-        return null();
-    }
-
     Node importHolder = handler.newPosHolder(pos());
     if (!importHolder)
         return null();
 
     TokenKind next;
     if (!tokenStream.getToken(&next))
         return null();
-    if (next != TokenKind::Dot) {
-        error(JSMSG_UNEXPECTED_TOKEN, "dot", TokenKindToDesc(next));
-        return null();
-    }
-
-    if (!tokenStream.getToken(&next))
-        return null();
-    if (next != TokenKind::Meta) {
-        error(JSMSG_UNEXPECTED_TOKEN, "meta", TokenKindToDesc(next));
-        return null();
-    }
-
-    Node metaHolder = handler.newPosHolder(pos());
-    if (!metaHolder)
-        return null();
-
-    return handler.newImportMeta(importHolder, metaHolder);
+
+    if (next == TokenKind::Dot) {
+        if (!tokenStream.getToken(&next))
+            return null();
+        if (next != TokenKind::Meta) {
+            error(JSMSG_UNEXPECTED_TOKEN, "meta", TokenKindToDesc(next));
+            return null();
+        }
+
+        if (parseGoal() != ParseGoal::Module) {
+            errorAt(pos().begin, JSMSG_IMPORT_META_OUTSIDE_MODULE);
+            return null();
+        }
+
+        Node metaHolder = handler.newPosHolder(pos());
+        if (!metaHolder)
+            return null();
+
+        return handler.newImportMeta(importHolder, metaHolder);
+    } else if (next == TokenKind::LeftParen) {
+        Node arg = assignExpr(InAllowed, yieldHandling, TripledotProhibited);
+        if (!arg)
+            return null();
+
+        MUST_MATCH_TOKEN_MOD(TokenKind::RightParen, TokenStream::Operand, JSMSG_PAREN_AFTER_ARGS);
+
+        return handler.newCallImport(importHolder, arg);
+    } else {
+        error(JSMSG_UNEXPECTED_TOKEN_NO_EXPECT, TokenKindToDesc(next));
+        return null();
+    }
 }
 
 template <class ParseHandler, typename CharT>
 typename ParseHandler::Node
 GeneralParser<ParseHandler, CharT>::primaryExpr(YieldHandling yieldHandling,
                                                 TripledotHandling tripledotHandling,
                                                 TokenKind tt, PossibleError* possibleError,
                                                 InvokedPrediction invoked /* = PredictUninvoked */)
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -1040,17 +1040,17 @@ class MOZ_STACK_CLASS GeneralParser
     Node labeledItem(YieldHandling yieldHandling);
 
     Node ifStatement(YieldHandling yieldHandling);
     Node consequentOrAlternative(YieldHandling yieldHandling);
 
     Node lexicalDeclaration(YieldHandling yieldHandling, DeclarationKind kind);
 
     inline Node importDeclaration();
-    Node importDeclarationOrImportMeta(YieldHandling yieldHandling);
+    Node importDeclarationOrImportExpr(YieldHandling yieldHandling);
 
     Node exportFrom(uint32_t begin, Node specList);
     Node exportBatch(uint32_t begin);
     inline bool checkLocalExportNames(Node node);
     Node exportClause(uint32_t begin);
     Node exportFunctionDeclaration(uint32_t begin, uint32_t toStringStart,
                                    FunctionAsyncKind asyncKind = FunctionAsyncKind::SyncFunction);
     Node exportVariableStatement(uint32_t begin);
@@ -1140,17 +1140,17 @@ class MOZ_STACK_CLASS GeneralParser
     Node primaryExpr(YieldHandling yieldHandling, TripledotHandling tripledotHandling,
                      TokenKind tt, PossibleError* possibleError,
                      InvokedPrediction invoked = PredictUninvoked);
     Node exprInParens(InHandling inHandling, YieldHandling yieldHandling,
                       TripledotHandling tripledotHandling, PossibleError* possibleError = nullptr);
 
     bool tryNewTarget(Node& newTarget);
 
-    Node importMeta();
+    Node importExpr(YieldHandling yieldHandling);
 
     Node methodDefinition(uint32_t toStringStart, PropertyType propType, HandleAtom funName);
 
     /*
      * Additional JS parsers.
      */
     bool functionArguments(YieldHandling yieldHandling, FunctionSyntaxKind kind,
                            Node funcpn);
--- a/js/src/frontend/SyntaxParseHandler.h
+++ b/js/src/frontend/SyntaxParseHandler.h
@@ -297,16 +297,19 @@ class SyntaxParseHandler
         return NodeGeneric;
     }
     Node newExportBatchSpec(const TokenPos& pos) {
         return NodeGeneric;
     }
     Node newImportMeta(Node importHolder, Node metaHolder) {
         return NodeGeneric;
     }
+    Node newCallImport(Node importHolder, Node singleArg) {
+        return NodeGeneric;
+    }
 
     Node newSetThis(Node thisName, Node value) { return value; }
 
     Node newExprStatement(Node expr, uint32_t end) {
         return expr == NodeUnparenthesizedString ? NodeStringExprStatement : NodeGeneric;
     }
 
     Node newIfStatement(uint32_t begin, Node cond, Node then, Node else_) { return NodeGeneric; }
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/modules/dynamic-import-expression.js
@@ -0,0 +1,85 @@
+load(libdir + "match.js");
+load(libdir + "asserts.js");
+
+var { Pattern, MatchError } = Match;
+
+program = (elts) => Pattern({
+    type: "Program",
+    body: elts
+});
+expressionStatement = (expression) => Pattern({
+    type: "ExpressionStatement",
+    expression: expression
+});
+assignmentExpression = (left, operator, right) => Pattern({
+    type: "AssignmentExpression",
+    operator: operator,
+    left: left,
+    right: right
+});
+ident = (name) => Pattern({
+    type: "Identifier",
+    name: name
+});
+importCall = (ident, singleArg) => Pattern({
+    type: "CallImport",
+    ident: ident,
+    arg: singleArg
+});
+
+function parseAsClassicScript(source)
+{
+    return Reflect.parse(source);
+}
+
+function parseAsModuleScript(source)
+{
+    return Reflect.parse(source, {target: "module"});
+}
+
+for (let parse of [parseAsModuleScript, parseAsClassicScript]) {
+    program([
+        expressionStatement(
+            importCall(
+                ident("import"),
+                ident("foo")
+            )
+        )
+    ]).assert(parse("import(foo);"));
+
+    program([
+        expressionStatement(
+            assignmentExpression(
+                ident("x"),
+                "=",
+                importCall(
+                    ident("import"),
+                    ident("foo")
+                )
+            )
+        )
+    ]).assert(parse("x = import(foo);"));
+}
+
+function assertParseThrowsSyntaxError(source)
+{
+    assertThrowsInstanceOf(() => parseAsClassicScript(source), SyntaxError);
+    assertThrowsInstanceOf(() => parseAsModuleScript(source), SyntaxError);
+}
+
+assertParseThrowsSyntaxError("import");
+assertParseThrowsSyntaxError("import(");
+assertParseThrowsSyntaxError("import(1,");
+assertParseThrowsSyntaxError("import(1, 2");
+assertParseThrowsSyntaxError("import(1, 2)");
+assertParseThrowsSyntaxError("x = import");
+assertParseThrowsSyntaxError("x = import(");
+assertParseThrowsSyntaxError("x = import(1,");
+assertParseThrowsSyntaxError("x = import(1, 2");
+assertParseThrowsSyntaxError("x = import(1, 2)");
+
+// import() is not implemented.
+assertThrowsInstanceOf(() => eval("import('foo')"),
+                       SyntaxError);
+assertThrowsInstanceOf(() => parseModule("import('foo')"),
+                       SyntaxError);
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -258,17 +258,17 @@ MSG_DEF(JSMSG_FINALLY_WITHOUT_TRY,     0
 MSG_DEF(JSMSG_FORBIDDEN_AS_STATEMENT,  1, JSEXN_SYNTAXERR, "{0} can't appear in single-statement context")
 MSG_DEF(JSMSG_FOR_AWAIT_OUTSIDE_ASYNC, 0, JSEXN_SYNTAXERR, "for await (... of ...) is only valid in async functions and async generators")
 MSG_DEF(JSMSG_FROM_AFTER_IMPORT_CLAUSE, 0, JSEXN_SYNTAXERR, "missing keyword 'from' after import clause")
 MSG_DEF(JSMSG_FROM_AFTER_EXPORT_STAR,  0, JSEXN_SYNTAXERR, "missing keyword 'from' after export *")
 MSG_DEF(JSMSG_GARBAGE_AFTER_INPUT,     2, JSEXN_SYNTAXERR, "unexpected garbage after {0}, starting with {1}")
 MSG_DEF(JSMSG_IDSTART_AFTER_NUMBER,    0, JSEXN_SYNTAXERR, "identifier starts immediately after numeric literal")
 MSG_DEF(JSMSG_BAD_ESCAPE,              0, JSEXN_SYNTAXERR, "invalid escape sequence")
 MSG_DEF(JSMSG_ILLEGAL_CHARACTER,       0, JSEXN_SYNTAXERR, "illegal character")
-MSG_DEF(JSMSG_IMPORT_OUTSIDE_MODULE,   0, JSEXN_SYNTAXERR, "the import keyword may only appear in a module")
+MSG_DEF(JSMSG_IMPORT_META_OUTSIDE_MODULE, 0, JSEXN_SYNTAXERR, "import.meta may only appear in a module")
 MSG_DEF(JSMSG_IMPORT_DECL_AT_TOP_LEVEL, 0, JSEXN_SYNTAXERR, "import declarations may only appear at top level of a module")
 MSG_DEF(JSMSG_OF_AFTER_FOR_LOOP_DECL,  0, JSEXN_SYNTAXERR, "a declaration in the head of a for-of loop can't have an initializer")
 MSG_DEF(JSMSG_IN_AFTER_LEXICAL_FOR_DECL,0,JSEXN_SYNTAXERR, "a lexical declaration in the head of a for-in loop can't have an initializer")
 MSG_DEF(JSMSG_INVALID_FOR_IN_DECL_WITH_INIT,0,JSEXN_SYNTAXERR,"for-in loop head declarations may not have initializers")
 MSG_DEF(JSMSG_INVALID_ID,              1, JSEXN_SYNTAXERR, "{0} is an invalid identifier")
 MSG_DEF(JSMSG_LABEL_NOT_FOUND,         0, JSEXN_SYNTAXERR, "label not found")
 MSG_DEF(JSMSG_LEXICAL_DECL_NOT_IN_BLOCK,   1, JSEXN_SYNTAXERR, "{0} declaration not directly within block")
 MSG_DEF(JSMSG_LEXICAL_DECL_LABEL,      1, JSEXN_SYNTAXERR, "{0} declarations cannot be labelled")
@@ -601,16 +601,17 @@ MSG_DEF(JSMSG_REINIT_THIS,       0, JSEX
 MSG_DEF(JSMSG_BAD_DEFAULT_EXPORT,        0, JSEXN_SYNTAXERR, "default export cannot be provided by export *")
 MSG_DEF(JSMSG_MISSING_INDIRECT_EXPORT,   0, JSEXN_SYNTAXERR, "indirect export not found")
 MSG_DEF(JSMSG_AMBIGUOUS_INDIRECT_EXPORT, 0, JSEXN_SYNTAXERR, "ambiguous indirect export")
 MSG_DEF(JSMSG_MISSING_IMPORT,            0, JSEXN_SYNTAXERR, "import not found")
 MSG_DEF(JSMSG_AMBIGUOUS_IMPORT,          0, JSEXN_SYNTAXERR, "ambiguous import")
 MSG_DEF(JSMSG_MISSING_NAMESPACE_EXPORT,  0, JSEXN_SYNTAXERR, "export not found for namespace")
 MSG_DEF(JSMSG_MISSING_EXPORT,            1, JSEXN_SYNTAXERR, "local binding for export '{0}' not found")
 MSG_DEF(JSMSG_BAD_MODULE_STATUS,         0, JSEXN_INTERNALERR, "module record has unexpected status")
+MSG_DEF(JSMSG_NO_DYNAMIC_IMPORT,         0, JSEXN_SYNTAXERR, "dynamic module import is not implemented")
 
 // Promise
 MSG_DEF(JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF,       0, JSEXN_TYPEERR, "A promise cannot be resolved with itself.")
 MSG_DEF(JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY, 0, JSEXN_TYPEERR, "GetCapabilitiesExecutor function already invoked with non-undefined values.")
 MSG_DEF(JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE,    0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the resolve function.")
 MSG_DEF(JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE,     0, JSEXN_TYPEERR, "A Promise subclass passed a non-callable value as the reject function.")
 MSG_DEF(JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON,0, JSEXN_INTERNALERR, "Promise rejection value is a non-unwrappable cross-compartment wrapper.")
 
--- a/js/src/jsast.tbl
+++ b/js/src/jsast.tbl
@@ -33,16 +33,17 @@ ASTDEF(AST_ARROW_EXPR,            "Arrow
 ASTDEF(AST_ARRAY_EXPR,            "ArrayExpression",                "arrayExpression")
 ASTDEF(AST_SPREAD_EXPR,           "SpreadExpression",               "spreadExpression")
 ASTDEF(AST_OBJECT_EXPR,           "ObjectExpression",               "objectExpression")
 ASTDEF(AST_THIS_EXPR,             "ThisExpression",                 "thisExpression")
 ASTDEF(AST_YIELD_EXPR,            "YieldExpression",                "yieldExpression")
 ASTDEF(AST_CLASS_EXPR,            "ClassExpression",                "classExpression")
 ASTDEF(AST_METAPROPERTY,          "MetaProperty",                   "metaProperty")
 ASTDEF(AST_SUPER,                 "Super",                          "super")
+ASTDEF(AST_CALL_IMPORT,           "CallImport",                     "callImport")
 
 ASTDEF(AST_EMPTY_STMT,            "EmptyStatement",                 "emptyStatement")
 ASTDEF(AST_BLOCK_STMT,            "BlockStatement",                 "blockStatement")
 ASTDEF(AST_EXPR_STMT,             "ExpressionStatement",            "expressionStatement")
 ASTDEF(AST_LAB_STMT,              "LabeledStatement",               "labeledStatement")
 ASTDEF(AST_IF_STMT,               "IfStatement",                    "ifStatement")
 ASTDEF(AST_SWITCH_STMT,           "SwitchStatement",                "switchStatement")
 ASTDEF(AST_WHILE_STMT,            "WhileStatement",                 "whileStatement")
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -85,19 +85,16 @@
 #include "mozilla/dom/nsSynthVoiceRegistry.h"
 #endif
 
 #include "mozilla/dom/PushNotifier.h"
 using mozilla::dom::PushNotifier;
 #define PUSHNOTIFIER_CID \
 { 0x2fc2d3e3, 0x020f, 0x404e, { 0xb0, 0x6a, 0x6e, 0xcf, 0x3e, 0xa2, 0x33, 0x4a } }
 
-#include "AudioChannelAgent.h"
-using mozilla::dom::AudioChannelAgent;
-
 // Editor stuff
 #include "mozilla/EditorController.h" //CID
 
 #include "nsScriptSecurityManager.h"
 #include "ExpandedPrincipal.h"
 #include "mozilla/ContentPrincipal.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/SystemPrincipal.h"
@@ -135,17 +132,16 @@ static void Shutdown();
 #include "nsDeviceSensors.h"
 #include "mozilla/dom/nsContentSecurityManager.h"
 #include "mozilla/dom/nsCSPService.h"
 #include "mozilla/dom/nsCSPContext.h"
 #include "nsIPowerManagerService.h"
 #include "nsIMediaManager.h"
 #include "mozilla/dom/nsMixedContentBlocker.h"
 
-#include "AudioChannelService.h"
 #include "mozilla/net/WebSocketEventService.h"
 
 #include "mozilla/dom/power/PowerManagerService.h"
 
 #include "nsIPresentationService.h"
 
 #include "MediaManager.h"
 
@@ -206,18 +202,16 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(StorageActivityService,
                                          StorageActivityService::GetOrCreate)
 
 #ifdef MOZ_WEBSPEECH
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSynthVoiceRegistry,
                                          nsSynthVoiceRegistry::GetInstanceForService)
 #endif
 
-NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent)
-
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors)
 
 #if defined(ANDROID)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService,
                                          PowerManagerService::GetInstance)
@@ -419,24 +413,19 @@ static nsresult                         
     return rv;                                                                \
 }                                                                             \
 
 #define NS_GEOLOCATION_CID \
   { 0x1E1C3FF, 0x94A, 0xD048, { 0x44, 0xB4, 0x62, 0xD2, 0x9C, 0x7B, 0x4F, 0x39 } }
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(Geolocation, Geolocation::NonWindowSingleton)
 
-#define NS_AUDIOCHANNEL_SERVICE_CID \
-  { 0xf712e983, 0x048a, 0x443f, { 0x88, 0x02, 0xfc, 0xc3, 0xd9, 0x27, 0xce, 0xac }}
-
 #define NS_WEBSOCKETEVENT_SERVICE_CID \
   { 0x31689828, 0xda66, 0x49a6, { 0x87, 0x0c, 0xdf, 0x62, 0xb8, 0x3f, 0xe7, 0x89 }}
 
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioChannelService, AudioChannelService::GetOrCreate)
-
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WebSocketEventService, WebSocketEventService::GetOrCreate)
 
 #ifdef MOZ_WEBSPEECH_TEST_BACKEND
 NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsContentSecurityManager)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsCSPContext)
@@ -530,23 +519,21 @@ NS_DEFINE_NAMED_CID(NS_DOMSESSIONSTORAGE
 NS_DEFINE_NAMED_CID(NS_DOMLOCALSTORAGEMANAGER_CID);
 NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID);
 NS_DEFINE_NAMED_CID(QUOTAMANAGER_SERVICE_CID);
 NS_DEFINE_NAMED_CID(SERVICEWORKERMANAGER_CID);
 NS_DEFINE_NAMED_CID(STORAGEACTIVITYSERVICE_CID);
 NS_DEFINE_NAMED_CID(NOTIFICATIONTELEMETRYSERVICE_CID);
 NS_DEFINE_NAMED_CID(PUSHNOTIFIER_CID);
 NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_CID);
-NS_DEFINE_NAMED_CID(NS_AUDIOCHANNELAGENT_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_EDITINGCONTROLLER_CID);
 NS_DEFINE_NAMED_CID(NS_EDITORCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_EDITINGCOMMANDTABLE_CID);
 NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
-NS_DEFINE_NAMED_CID(NS_AUDIOCHANNEL_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_WEBSOCKETEVENT_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
 NS_DEFINE_NAMED_CID(NS_CONTENTSECURITYMANAGER_CID);
 NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_CSPCONTEXT_CID);
 NS_DEFINE_NAMED_CID(NS_MIXEDCONTENTBLOCKER_CID);
 NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID);
@@ -760,23 +747,21 @@ static const mozilla::Module::CIDEntry k
   { &kNS_DOMLOCALSTORAGEMANAGER_CID, false, nullptr, LocalStorageManagerConstructor },
   { &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor },
   { &kQUOTAMANAGER_SERVICE_CID, false, nullptr, QuotaManagerServiceConstructor },
   { &kSERVICEWORKERMANAGER_CID, false, nullptr, ServiceWorkerManagerConstructor },
   { &kSTORAGEACTIVITYSERVICE_CID, false, nullptr, StorageActivityServiceConstructor },
   { &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor },
   { &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor },
   { &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor },
-  { &kNS_AUDIOCHANNELAGENT_CID, true, nullptr, AudioChannelAgentConstructor },
   { &kNS_EDITORCONTROLLER_CID, false, nullptr, EditorControllerConstructor },
   { &kNS_EDITINGCONTROLLER_CID, false, nullptr, nsEditingControllerConstructor },
   { &kNS_EDITORCOMMANDTABLE_CID, false, nullptr, nsEditorCommandTableConstructor },
   { &kNS_EDITINGCOMMANDTABLE_CID, false, nullptr, nsEditingCommandTableConstructor },
   { &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor },
-  { &kNS_AUDIOCHANNEL_SERVICE_CID, false, nullptr, AudioChannelServiceConstructor },
   { &kNS_WEBSOCKETEVENT_SERVICE_CID, false, nullptr, WebSocketEventServiceConstructor },
   { &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
 #ifdef MOZ_WEBSPEECH_TEST_BACKEND
   { &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor },
 #endif
 #ifdef MOZ_WEBSPEECH
   { &kNS_SYNTHVOICEREGISTRY_CID, true, nullptr, nsSynthVoiceRegistryConstructor },
 #endif
@@ -860,21 +845,19 @@ static const mozilla::Module::ContractID
   { "@mozilla.org/dom/sessionStorage-manager;1", &kNS_DOMSESSIONSTORAGEMANAGER_CID },
   { DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID },
   { QUOTAMANAGER_SERVICE_CONTRACTID, &kQUOTAMANAGER_SERVICE_CID },
   { SERVICEWORKERMANAGER_CONTRACTID, &kSERVICEWORKERMANAGER_CID },
   { STORAGE_ACTIVITY_SERVICE_CONTRACTID, &kSTORAGEACTIVITYSERVICE_CID },
   { NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID },
   { PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID },
   { WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_CID },
-  { NS_AUDIOCHANNELAGENT_CONTRACTID, &kNS_AUDIOCHANNELAGENT_CID },
   { "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID },
   { "@mozilla.org/editor/editingcontroller;1", &kNS_EDITINGCONTROLLER_CID },
   { "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
-  { "@mozilla.org/audiochannel/service;1", &kNS_AUDIOCHANNEL_SERVICE_CID },
   { "@mozilla.org/websocketevent/service;1", &kNS_WEBSOCKETEVENT_SERVICE_CID },
   { "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
 #ifdef MOZ_WEBSPEECH_TEST_BACKEND
   { NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID },
 #endif
 #ifdef MOZ_WEBSPEECH
   { NS_SYNTHVOICEREGISTRY_CONTRACTID, &kNS_SYNTHVOICEREGISTRY_CID },
 #endif
--- a/taskcluster/scripts/misc/build-rust-size.sh
+++ b/taskcluster/scripts/misc/build-rust-size.sh
@@ -1,14 +1,14 @@
 #!/bin/bash
 set -x -e -v
 
 OWNER=luser
 PROJECT=rust-size
-PROJECT_REVISION=4a5d9148f50dc037dc230f10b8fc4e5ca00016aa
+PROJECT_REVISION=ab659d93b1faba95307df952aefe3fbed3583669
 
 # This script is for building rust-size
 case "$(uname -s)" in
 Linux)
     WORKSPACE=$HOME/workspace
     UPLOAD_DIR=$HOME/artifacts
     COMPRESS_EXT=xz
     ;;
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-fetch-error.sub.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-fetch-error.sub.html.ini
@@ -1,4 +1,8 @@
 [dynamic-imports-fetch-error.sub.html]
+  expected: ERROR
   [import(): error cases occuring during fetching]
     expected: FAIL
 
+  [import() must reject when there is a wrong MIME type]
+    expected: FAIL
+
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html.ini
@@ -1,4 +1,8 @@
 [dynamic-imports-script-error.html]
+  expected: ERROR
   [import(): error cases caused by the imported module script]
     expected: FAIL
 
+  [import() must reject when there is a parse error]
+    expected: FAIL
+
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports.html.ini
@@ -1,4 +1,7 @@
 [dynamic-imports.html]
   [Basic dynamic imports]
     expected: FAIL
 
+  [Dynamic imports should resolve module.]
+    expected: FAIL
+
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html.ini
@@ -1,7 +1,10 @@
 [propagate-nonce-external-classic.html]
   [Untitled]
     expected: FAIL
 
   [propagate-nonce-external-classic]
     expected: FAIL
 
+  [Dynamically imported module should eval when imported from script w/ a valid nonce.]
+    expected: FAIL
+
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-module.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-module.html.ini
@@ -1,7 +1,10 @@
 [propagate-nonce-external-module.html]
   [Untitled]
     expected: FAIL
 
   [propagate-nonce-external-module]
     expected: FAIL
 
+  [Dynamically imported module should eval when imported from script w/ a valid nonce.]
+    expected: FAIL
+
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html.ini
@@ -1,7 +1,10 @@
 [propagate-nonce-inline-classic.html]
   [Untitled]
     expected: FAIL
 
   [propagate-nonce-inline-classic]
     expected: FAIL
 
+  [Dynamically imported module should eval when imported from script w/ a valid nonce.]
+    expected: FAIL
+
--- a/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-module.html.ini
+++ b/testing/web-platform/meta/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-module.html.ini
@@ -1,7 +1,10 @@
 [propagate-nonce-inline-module.html]
   [Untitled]
     expected: FAIL
 
   [propagate-nonce-inline-module]
     expected: FAIL
 
+  [Dynamically imported module should eval when imported from script w/ a valid nonce.]
+    expected: FAIL
+