Bug 1028497 - Part 27: Rename some things. r=jdaggett
authorCameron McCormack <cam@mcc.id.au>
Thu, 02 Oct 2014 12:32:10 +1000
changeset 208340 9463ab08610e0da0b271ad4d058f514075e2cb63
parent 208339 7e52db037dd484fc5f24a5b1e74c0cd33aae9ba8
child 208341 109ae9a694cc2cab0f365b1a76f5596fc7e1cf49
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjdaggett
bugs1028497
milestone35.0a1
Bug 1028497 - Part 27: Rename some things. r=jdaggett
layout/style/FontFace.cpp
layout/style/FontFace.h
layout/style/FontFaceSet.cpp
layout/style/FontFaceSet.h
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -336,17 +336,17 @@ FontFace::Constructor(const GlobalObject
   NS_DispatchToMainThread(task);
 
   return obj.forget();
 }
 
 void
 FontFace::Initialize(FontFaceInitializer* aInitializer)
 {
-  MOZ_ASSERT(!IsConnected());
+  MOZ_ASSERT(!HasRule());
   MOZ_ASSERT(mSourceType == SourceType(0));
 
   if (aInitializer->mSourceType == eSourceType_URLs) {
     if (!ParseDescriptor(eCSSFontDesc_Src,
                          aInitializer->mSourceString,
                          mDescriptors->mSrc)) {
       if (mLoaded) {
         // The asynchronous SetStatus call we are about to do assumes that for
@@ -557,18 +557,18 @@ FontFace::Load(ErrorResult& aRv)
 }
 
 void
 FontFace::DoLoad()
 {
   MOZ_ASSERT(mInitialized);
 
   if (!mUserFontEntry) {
-    MOZ_ASSERT(!IsConnected(),
-               "CSS-connected FontFace objects should already have a user font "
+    MOZ_ASSERT(!HasRule(),
+               "Rule backed FontFace objects should already have a user font "
                "entry by the time Load() can be called on them");
 
     nsRefPtr<gfxUserFontEntry> newEntry =
       mFontFaceSet->FindOrCreateUserFontEntryFromFontFace(this);
     if (!newEntry) {
       return;
     }
 
@@ -653,19 +653,19 @@ FontFace::ParseDescriptor(nsCSSFontDesc 
   return true;
 }
 
 void
 FontFace::SetDescriptor(nsCSSFontDesc aFontDesc,
                         const nsAString& aValue,
                         ErrorResult& aRv)
 {
-  NS_ASSERTION(!IsConnected(),
-               "we don't handle rule-connected FontFace objects yet");
-  if (IsConnected()) {
+  NS_ASSERTION(!HasRule(),
+               "we don't handle rule backed FontFace objects yet");
+  if (HasRule()) {
     return;
   }
 
   nsCSSValue parsedValue;
   if (!ParseDescriptor(aFontDesc, aValue, parsedValue)) {
     aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
     return;
   }
@@ -675,17 +675,17 @@ FontFace::SetDescriptor(nsCSSFontDesc aF
   // XXX Setting descriptors doesn't actually have any effect on FontFace
   // objects that have started loading or have already been loaded.
 }
 
 bool
 FontFace::SetDescriptors(const nsAString& aFamily,
                          const FontFaceDescriptors& aDescriptors)
 {
-  MOZ_ASSERT(!IsConnected());
+  MOZ_ASSERT(!HasRule());
   MOZ_ASSERT(!mDescriptors);
 
   mDescriptors = new CSSFontFaceDescriptors;
 
   // Parse all of the mDescriptors in aInitializer, which are the values
   // we got from the JS constructor.
   if (!ParseDescriptor(eCSSFontDesc_Family,
                        aFamily,
@@ -740,17 +740,17 @@ FontFace::OnInitialized()
   if (mInFontFaceSet) {
     mFontFaceSet->OnFontFaceInitialized(this);
   }
 }
 
 void
 FontFace::GetDesc(nsCSSFontDesc aDescID, nsCSSValue& aResult) const
 {
-  if (IsConnected()) {
+  if (HasRule()) {
     MOZ_ASSERT(mRule);
     MOZ_ASSERT(!mDescriptors);
     mRule->GetDesc(aDescID, aResult);
   } else {
     aResult = mDescriptors->Get(aDescID);
   }
 }
 
@@ -819,17 +819,17 @@ FontFace::GetFamilyName(nsString& aResul
   }
 
   return !aResult.IsEmpty();
 }
 
 void
 FontFace::DisconnectFromRule()
 {
-  MOZ_ASSERT(IsConnected());
+  MOZ_ASSERT(HasRule());
 
   // Make a copy of the descriptors.
   mDescriptors = new CSSFontFaceDescriptors;
   mRule->GetDescriptors(*mDescriptors);
 
   mRule->SetFontFace(nullptr);
   mRule = nullptr;
   mInFontFaceSet = false;
--- a/layout/style/FontFace.h
+++ b/layout/style/FontFace.h
@@ -91,23 +91,23 @@ public:
    */
   bool IsInFontFaceSet() { return mInFontFaceSet; }
 
   /**
    * Sets whether this object is in a FontFaceSet.  This is called by the
    * FontFaceSet when Add, Remove, etc. are called.
    */
   void SetIsInFontFaceSet(bool aInFontFaceSet) {
-    MOZ_ASSERT(!(!aInFontFaceSet && IsConnected()),
+    MOZ_ASSERT(!(!aInFontFaceSet && HasRule()),
                "use DisconnectFromRule instead");
     mInFontFaceSet = aInFontFaceSet;
   }
 
   /**
-   * Returns whether this FontFace is initialized.  A CSS-connected
+   * Returns whether this FontFace is initialized.  A rule backed
    * FontFace is considered initialized at construction time.  For
    * FontFace objects created using the FontFace JS constructor, it
    * is once all the descriptors have been parsed.
    */
   bool IsInitialized() const { return mInitialized; }
 
   FontFaceSet* GetFontFaceSet() const { return mFontFaceSet; }
 
@@ -117,17 +117,17 @@ public:
    * '"Times"').  Returns whether a valid family name was available.
    */
   bool GetFamilyName(nsString& aResult);
 
   /**
    * Returns whether this object is CSS-connected, i.e. reflecting an
    * @font-face rule.
    */
-  bool IsConnected() const { return mRule; }
+  bool HasRule() const { return mRule; }
 
   /**
    * Breaks the connection between this FontFace and its @font-face rule.
    */
   void DisconnectFromRule();
 
   /**
    * Returns whether there is an ArrayBuffer or ArrayBufferView of font
@@ -231,17 +231,17 @@ private:
   nsCOMPtr<nsISupports> mParent;
   nsPresContext* mPresContext;
 
   // A Promise that is fulfilled once the font represented by this FontFace
   // is loaded, and is rejected if the load fails.
   nsRefPtr<mozilla::dom::Promise> mLoaded;
 
   // The @font-face rule this FontFace object is reflecting, if it is a
-  // CSS-connected FontFace.
+  // rule backed FontFace.
   nsRefPtr<nsCSSFontFaceRule> mRule;
 
   // The FontFace object's user font entry.  This is initially null, but is set
   // during FontFaceSet::UpdateRules and when a FontFace is explicitly loaded.
   nsRefPtr<Entry> mUserFontEntry;
 
   // The current load status of the font represented by this FontFace.
   // Note that we can't just reflect the value of the gfxUserFontEntry's
@@ -260,17 +260,17 @@ private:
   SourceType mSourceType;
 
   // If the FontFace was constructed with an ArrayBuffer(View), this is a
   // copy of the data from it.
   uint8_t* mSourceBuffer;
   uint32_t mSourceBufferLength;
 
   // The values corresponding to the font face descriptors, if we are not
-  // a CSS-connected FontFace object.  For CSS-connected objects, we use
+  // a rule backed FontFace object.  For rule backed objects, we use
   // the descriptors stored in mRule.
   nsAutoPtr<mozilla::CSSFontFaceDescriptors> mDescriptors;
 
   // The FontFaceSet this FontFace is associated with, regardless of whether
   // it is currently "in" the set.
   nsRefPtr<FontFaceSet> mFontFaceSet;
 
   // Whether this FontFace appears in the FontFaceSet.
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -52,46 +52,46 @@ GetFontFaceSetLog()
 #define LOG(args) PR_LOG(GetFontFaceSetLog(), PR_LOG_DEBUG, args)
 #define LOG_ENABLED() PR_LOG_TEST(GetFontFaceSetLog(), PR_LOG_DEBUG)
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(FontFaceSet)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(FontFaceSet, DOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument);
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mReady);
-  for (size_t i = 0; i < tmp->mConnectedFaces.Length(); i++) {
-    NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnectedFaces[i].mFontFace);
+  for (size_t i = 0; i < tmp->mRuleFaces.Length(); i++) {
+    NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRuleFaces[i].mFontFace);
   }
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOtherFaces);
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNonRuleFaces);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(FontFaceSet, DOMEventTargetHelper)
   tmp->Disconnect();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument);
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mReady);
-  for (size_t i = 0; i < tmp->mConnectedFaces.Length(); i++) {
-    NS_IMPL_CYCLE_COLLECTION_UNLINK(mConnectedFaces[i].mFontFace);
+  for (size_t i = 0; i < tmp->mRuleFaces.Length(); i++) {
+    NS_IMPL_CYCLE_COLLECTION_UNLINK(mRuleFaces[i].mFontFace);
   }
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mOtherFaces);
+  NS_IMPL_CYCLE_COLLECTION_UNLINK(mNonRuleFaces);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_ADDREF_INHERITED(FontFaceSet, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(FontFaceSet, DOMEventTargetHelper)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FontFaceSet)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventListener)
   NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 FontFaceSet::FontFaceSet(nsPIDOMWindow* aWindow, nsPresContext* aPresContext)
   : DOMEventTargetHelper(aWindow)
   , mPresContext(aPresContext)
   , mDocument(aPresContext->Document())
   , mStatus(FontFaceSetLoadStatus::Loaded)
-  , mOtherFacesDirty(false)
+  , mNonRuleFacesDirty(false)
   , mReadyIsResolved(true)
   , mDispatchedLoadingEvent(false)
   , mHasLoadingFontFaces(false)
   , mHasLoadingFontFacesIsDirty(false)
 {
   MOZ_COUNT_CTOR(FontFaceSet);
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aWindow);
@@ -187,20 +187,20 @@ FontFaceSetLoadStatus
 FontFaceSet::Status()
 {
   mPresContext->FlushUserFontSet();
   return mStatus;
 }
 
 #ifdef DEBUG
 bool
-FontFaceSet::HasConnectedFontFace(FontFace* aFontFace)
+FontFaceSet::HasRuleFontFace(FontFace* aFontFace)
 {
-  for (size_t i = 0; i < mConnectedFaces.Length(); i++) {
-    if (mConnectedFaces[i].mFontFace == aFontFace) {
+  for (size_t i = 0; i < mRuleFaces.Length(); i++) {
+    if (mRuleFaces[i].mFontFace == aFontFace) {
       return true;
     }
   }
   return false;
 }
 #endif
 
 FontFaceSet*
@@ -212,93 +212,93 @@ FontFaceSet::Add(FontFace& aFontFace, Er
   // and we also restrict the FontFaceSet to contain only FontFaces created
   // in the same window.
 
   if (aFontFace.GetFontFaceSet() != this) {
     aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
     return nullptr;
   }
 
-  if (aFontFace.IsConnected()) {
+  if (aFontFace.HasRule()) {
     aRv.Throw(NS_ERROR_DOM_INVALID_MODIFICATION_ERR);
     return nullptr;
   }
 
   if (aFontFace.IsInFontFaceSet()) {
     return this;
   }
 
   bool removed = mUnavailableFaces.RemoveElement(&aFontFace);
   if (!removed) {
     MOZ_ASSERT(false, "should have found aFontFace in mUnavailableFaces");
     return this;
   }
 
   aFontFace.SetIsInFontFaceSet(true);
 
-  MOZ_ASSERT(!mOtherFaces.Contains(&aFontFace),
-             "FontFace should not occur in mOtherFaces twice");
+  MOZ_ASSERT(!mNonRuleFaces.Contains(&aFontFace),
+             "FontFace should not occur in mNonRuleFaces twice");
 
-  mOtherFaces.AppendElement(&aFontFace);
+  mNonRuleFaces.AppendElement(&aFontFace);
 
-  mOtherFacesDirty = true;
+  mNonRuleFacesDirty = true;
   mPresContext->RebuildUserFontSet();
   mHasLoadingFontFacesIsDirty = true;
   CheckLoadingStarted();
   return this;
 }
 
 void
 FontFaceSet::Clear()
 {
   mPresContext->FlushUserFontSet();
 
-  if (mOtherFaces.IsEmpty()) {
+  if (mNonRuleFaces.IsEmpty()) {
     return;
   }
 
-  for (size_t i = 0; i < mOtherFaces.Length(); i++) {
-    FontFace* f = mOtherFaces[i];
+  for (size_t i = 0; i < mNonRuleFaces.Length(); i++) {
+    FontFace* f = mNonRuleFaces[i];
     f->SetIsInFontFaceSet(false);
 
     MOZ_ASSERT(!mUnavailableFaces.Contains(f),
                "FontFace should not occur in mUnavailableFaces twice");
 
     mUnavailableFaces.AppendElement(f);
   }
 
-  mOtherFaces.Clear();
-  mOtherFacesDirty = true;
+  mNonRuleFaces.Clear();
+  mNonRuleFacesDirty = true;
   mPresContext->RebuildUserFontSet();
   mHasLoadingFontFacesIsDirty = true;
   CheckLoadingFinished();
 }
 
 bool
 FontFaceSet::Delete(FontFace& aFontFace, ErrorResult& aRv)
 {
   mPresContext->FlushUserFontSet();
 
-  if (aFontFace.IsConnected()) {
+  if (aFontFace.HasRule()) {
     aRv.Throw(NS_ERROR_DOM_INVALID_MODIFICATION_ERR);
     return nullptr;
   }
 
-  if (!mOtherFaces.RemoveElement(&aFontFace)) {
+  if (!mNonRuleFaces.RemoveElement(&aFontFace)) {
     return false;
   }
 
   aFontFace.SetIsInFontFaceSet(false);
 
   MOZ_ASSERT(!mUnavailableFaces.Contains(&aFontFace),
              "FontFace should not occur in mUnavailableFaces twice");
 
   mUnavailableFaces.AppendElement(&aFontFace);
 
-  mOtherFacesDirty = true;
+  mNonRuleFacesDirty = true;
   mPresContext->RebuildUserFontSet();
   mHasLoadingFontFacesIsDirty = true;
   CheckLoadingFinished();
   return true;
 }
 
 bool
 FontFaceSet::HasAvailableFontFace(FontFace* aFontFace)
@@ -315,39 +315,39 @@ FontFaceSet::Has(FontFace& aFontFace)
   return HasAvailableFontFace(&aFontFace);
 }
 
 FontFace*
 FontFaceSet::IndexedGetter(uint32_t aIndex, bool& aFound)
 {
   mPresContext->FlushUserFontSet();
 
-  if (aIndex < mConnectedFaces.Length()) {
+  if (aIndex < mRuleFaces.Length()) {
     aFound = true;
-    return mConnectedFaces[aIndex].mFontFace;
+    return mRuleFaces[aIndex].mFontFace;
   }
 
-  aIndex -= mConnectedFaces.Length();
-  if (aIndex < mOtherFaces.Length()) {
+  aIndex -= mRuleFaces.Length();
+  if (aIndex < mNonRuleFaces.Length()) {
     aFound = true;
-    return mOtherFaces[aIndex];
+    return mNonRuleFaces[aIndex];
   }
 
   aFound = false;
   return nullptr;
 }
 
 uint32_t
 FontFaceSet::Length()
 {
   mPresContext->FlushUserFontSet();
 
   // Web IDL objects can only expose array index properties up to INT32_MAX.
 
-  size_t total = mConnectedFaces.Length() + mOtherFaces.Length();
+  size_t total = mRuleFaces.Length() + mNonRuleFaces.Length();
   return std::min<size_t>(total, INT32_MAX);
 }
 
 static PLDHashOperator DestroyIterator(nsPtrHashKey<nsFontFaceLoader>* aKey,
                                        void* aUserArg)
 {
   aKey->GetKey()->Cancel();
   return PL_DHASH_REMOVE;
@@ -355,28 +355,28 @@ static PLDHashOperator DestroyIterator(n
 
 void
 FontFaceSet::DestroyUserFontSet()
 {
   Disconnect();
   mDocument = nullptr;
   mPresContext = nullptr;
   mLoaders.EnumerateEntries(DestroyIterator, nullptr);
-  for (size_t i = 0; i < mConnectedFaces.Length(); i++) {
-    mConnectedFaces[i].mFontFace->DisconnectFromRule();
-    mConnectedFaces[i].mFontFace->SetUserFontEntry(nullptr);
+  for (size_t i = 0; i < mRuleFaces.Length(); i++) {
+    mRuleFaces[i].mFontFace->DisconnectFromRule();
+    mRuleFaces[i].mFontFace->SetUserFontEntry(nullptr);
   }
-  for (size_t i = 0; i < mOtherFaces.Length(); i++) {
-    mOtherFaces[i]->SetUserFontEntry(nullptr);
+  for (size_t i = 0; i < mNonRuleFaces.Length(); i++) {
+    mNonRuleFaces[i]->SetUserFontEntry(nullptr);
   }
   for (size_t i = 0; i < mUnavailableFaces.Length(); i++) {
     mUnavailableFaces[i]->SetUserFontEntry(nullptr);
   }
-  mConnectedFaces.Clear();
-  mOtherFaces.Clear();
+  mRuleFaces.Clear();
+  mNonRuleFaces.Clear();
   mUnavailableFaces.Clear();
   mReady = nullptr;
   mUserFontSet = nullptr;
 }
 
 void
 FontFaceSet::RemoveLoader(nsFontFaceLoader* aLoader)
 {
@@ -500,60 +500,60 @@ static PLDHashOperator RemoveIfEmpty(con
   return aFamily->GetFontList().Length() ? PL_DHASH_NEXT : PL_DHASH_REMOVE;
 }
 
 bool
 FontFaceSet::UpdateRules(const nsTArray<nsFontFaceRuleContainer>& aRules)
 {
   MOZ_ASSERT(mUserFontSet);
 
-  // If there was a change to the mOtherFaces array, then there could
+  // If there was a change to the mNonRuleFaces array, then there could
   // have been a modification to the user font set.
-  bool modified = mOtherFacesDirty;
-  mOtherFacesDirty = false;
+  bool modified = mNonRuleFacesDirty;
+  mNonRuleFacesDirty = false;
 
   // The @font-face rules that make up the user font set have changed,
   // so we need to update the set. However, we want to preserve existing
   // font entries wherever possible, so that we don't discard and then
   // re-download resources in the (common) case where at least some of the
   // same rules are still present.
 
   nsTArray<FontFaceRecord> oldRecords;
-  mConnectedFaces.SwapElements(oldRecords);
+  mRuleFaces.SwapElements(oldRecords);
 
   // Remove faces from the font family records; we need to re-insert them
   // because we might end up with faces in a different order even if they're
   // the same font entries as before. (The order can affect font selection
   // where multiple faces match the requested style, perhaps with overlapping
   // unicode-range coverage.)
   mUserFontSet->mFontFamilies.Enumerate(DetachFontEntries, nullptr);
 
   // Sometimes aRules has duplicate @font-face rules in it; we should make
   // that not happen, but in the meantime, don't try to insert the same
-  // FontFace object more than once into mConnectedFaces.  We track which
+  // FontFace object more than once into mRuleFaces.  We track which
   // ones we've handled in this table.
   nsTHashtable<nsPtrHashKey<nsCSSFontFaceRule>> handledRules;
 
   for (size_t i = 0, i_end = aRules.Length(); i < i_end; ++i) {
     // Insert each FontFace objects for each rule into our list, migrating old
     // font entries if possible rather than creating new ones; set  modified  to
     // true if we detect that rule ordering has changed, or if a new entry is
     // created.
     if (handledRules.Contains(aRules[i].mRule)) {
       continue;
     }
-    InsertConnectedFontFace(FontFaceForRule(aRules[i].mRule),
-                            aRules[i].mSheetType, oldRecords,
-                            modified);
+    InsertRuleFontFace(FontFaceForRule(aRules[i].mRule),
+                       aRules[i].mSheetType, oldRecords,
+                       modified);
     handledRules.PutEntry(aRules[i].mRule);
   }
 
-  for (size_t i = 0, i_end = mOtherFaces.Length(); i < i_end; ++i) {
-    // Do the same for the unconnected FontFace objects.
-    InsertUnconnectedFontFace(mOtherFaces[i], modified);
+  for (size_t i = 0, i_end = mNonRuleFaces.Length(); i < i_end; ++i) {
+    // Do the same for the non rule backed FontFace objects.
+    InsertNonRuleFontFace(mNonRuleFaces[i], modified);
   }
 
   // Remove any residual families that have no font entries (i.e., they were
   // not defined at all by the updated set of @font-face rules).
   mUserFontSet->mFontFamilies.Enumerate(RemoveIfEmpty, nullptr);
 
   // If any FontFace objects for rules are left in the old list, note that the
   // set has changed (even if the new set was built entirely by migrating old
@@ -561,32 +561,32 @@ FontFaceSet::UpdateRules(const nsTArray<
   if (oldRecords.Length() > 0) {
     modified = true;
     // Any in-progress loaders for obsolete rules should be cancelled,
     // as the resource being downloaded will no longer be required.
     // We need to explicitly remove any loaders here, otherwise the loaders
     // will keep their "orphaned" font entries alive until they complete,
     // even after the oldRules array is deleted.
     //
-    // XXX Now that it is possible for the author to hold on to a CSS-connected
+    // XXX Now that it is possible for the author to hold on to a rule backed
     // FontFace object, we shouldn't cancel loading here; instead we should do
     // it when the FontFace is GCed, if we can detect that.
     size_t count = oldRecords.Length();
     for (size_t i = 0; i < count; ++i) {
       nsRefPtr<FontFace> f = oldRecords[i].mFontFace;
       gfxUserFontEntry* userFontEntry = f->GetUserFontEntry();
       if (userFontEntry) {
         nsFontFaceLoader* loader = userFontEntry->GetLoader();
         if (loader) {
           loader->Cancel();
           RemoveLoader(loader);
         }
       }
 
-      // Any left over FontFace objects should also cease being CSS-connected.
+      // Any left over FontFace objects should also cease being rule backed.
       MOZ_ASSERT(!mUnavailableFaces.Contains(f),
                  "FontFace should not occur in mUnavailableFaces twice");
 
       mUnavailableFaces.AppendElement(f);
       f->DisconnectFromRule();
     }
   }
 
@@ -618,18 +618,18 @@ HasLocalSrc(const nsCSSValue::Array *aSr
 void
 FontFaceSet::IncrementGeneration(bool aIsRebuild)
 {
   MOZ_ASSERT(mUserFontSet);
   mUserFontSet->IncrementGeneration(aIsRebuild);
 }
 
 void
-FontFaceSet::InsertUnconnectedFontFace(FontFace* aFontFace,
-                                       bool& aFontSetModified)
+FontFaceSet::InsertNonRuleFontFace(FontFace* aFontFace,
+                                   bool& aFontSetModified)
 {
   if (!aFontFace->IsInitialized()) {
     // The FontFace is still waiting to be initialized, so don't create a
     // user font entry for it yet.  Once it has been initialized, it will
     // call OnFontFaceInitialized on us, which will end rebuild the user
     // font set and end up back in here.
     return;
   }
@@ -639,47 +639,46 @@ FontFaceSet::InsertUnconnectedFontFace(F
     // If there is no family name, this rule cannot contribute a
     // usable font, so there is no point in processing it further.
     return;
   }
 
   // Just create a new font entry if we haven't got one already.
   if (!aFontFace->GetUserFontEntry()) {
     // XXX Should we be checking mUserFontSet->mLocalRulesUsed like
-    // InsertConnectedFontFace does?
+    // InsertRuleFontFace does?
     nsRefPtr<gfxUserFontEntry> entry =
       FindOrCreateUserFontEntryFromFontFace(fontfamily, aFontFace,
                                             nsStyleSet::eDocSheet);
     if (!entry) {
       return;
     }
     aFontFace->SetUserFontEntry(entry);
   }
 
   aFontSetModified = true;
   mUserFontSet->AddUserFontEntry(fontfamily, aFontFace->GetUserFontEntry());
 }
 
 void
-FontFaceSet::InsertConnectedFontFace(
-                             FontFace* aFontFace, uint8_t aSheetType,
-                             nsTArray<FontFaceRecord>& aOldRecords,
-                             bool& aFontSetModified)
+FontFaceSet::InsertRuleFontFace(FontFace* aFontFace, uint8_t aSheetType,
+                                nsTArray<FontFaceRecord>& aOldRecords,
+                                bool& aFontSetModified)
 {
   nsAutoString fontfamily;
   if (!aFontFace->GetFamilyName(fontfamily)) {
     // If there is no family name, this rule cannot contribute a
     // usable font, so there is no point in processing it further.
     return;
   }
 
   bool remove = false;
   size_t removeIndex;
 
-  // This is a CSS-connected FontFace.  First, we check in aOldRecords; if
+  // This is a rule backed FontFace.  First, we check in aOldRecords; if
   // the FontFace for the rule exists there, just move it to the new record
   // list, and put the entry into the appropriate family.
   for (size_t i = 0; i < aOldRecords.Length(); ++i) {
     FontFaceRecord& rec = aOldRecords[i];
 
     if (rec.mFontFace == aFontFace &&
         rec.mSheetType == aSheetType) {
 
@@ -698,20 +697,20 @@ FontFaceSet::InsertConnectedFontFace(
         }
       }
 
       gfxUserFontEntry* entry = rec.mFontFace->GetUserFontEntry();
       MOZ_ASSERT(entry, "FontFace should have a gfxUserFontEntry by now");
 
       mUserFontSet->AddUserFontEntry(fontfamily, entry);
 
-      MOZ_ASSERT(!HasConnectedFontFace(rec.mFontFace),
-                 "FontFace should not occur in mConnectedFaces twice");
+      MOZ_ASSERT(!HasRuleFontFace(rec.mFontFace),
+                 "FontFace should not occur in mRuleFaces twice");
 
-      mConnectedFaces.AppendElement(rec);
+      mRuleFaces.AppendElement(rec);
       aOldRecords.RemoveElementAt(i);
       // note the set has been modified if an old rule was skipped to find
       // this one - something has been dropped, or ordering changed
       if (i > 0) {
         aFontSetModified = true;
       }
       return;
     }
@@ -723,33 +722,33 @@ FontFaceSet::InsertConnectedFontFace(
 
   if (!entry) {
     return;
   }
 
   if (remove) {
     // Although we broke out of the aOldRecords loop above, since we found
     // src local usage, and we're not using the old user font entry, we still
-    // are adding a record to mConnectedFaces with the same FontFace object.
+    // are adding a record to mRuleFaces with the same FontFace object.
     // Remove the old record so that we don't have the same FontFace listed
-    // in both mConnectedFaces and oldRecords, which would cause us to call
-    // DisconnectFromRule on a FontFace that should still be connected.
+    // in both mRuleFaces and oldRecords, which would cause us to call
+    // DisconnectFromRule on a FontFace that should still be rule backed.
     aOldRecords.RemoveElementAt(removeIndex);
   }
 
   FontFaceRecord rec;
   rec.mFontFace = aFontFace;
   rec.mSheetType = aSheetType;
 
   aFontFace->SetUserFontEntry(entry);
 
-  MOZ_ASSERT(!HasConnectedFontFace(aFontFace),
-             "FontFace should not occur in mConnectedFaces twice");
+  MOZ_ASSERT(!HasRuleFontFace(aFontFace),
+             "FontFace should not occur in mRuleFaces twice");
 
-  mConnectedFaces.AppendElement(rec);
+  mRuleFaces.AppendElement(rec);
 
   // this was a new rule and font entry, so note that the set was modified
   aFontSetModified = true;
 
   // Add the entry to the end of the list.  If an existing userfont entry was
   // returned by FindOrCreateUserFontEntryFromFontFace that was already stored
   // on the family, gfxUserFontFamily::AddFontEntry(), which AddUserFontEntry
   // calls, will automatically remove the earlier occurrence of the same
@@ -950,31 +949,31 @@ FontFaceSet::FindOrCreateUserFontEntryFr
                                             nullptr /* aUnicodeRanges */);
   return entry.forget();
 }
 
 nsCSSFontFaceRule*
 FontFaceSet::FindRuleForEntry(gfxFontEntry* aFontEntry)
 {
   NS_ASSERTION(!aFontEntry->mIsUserFontContainer, "only platform font entries");
-  for (uint32_t i = 0; i < mConnectedFaces.Length(); ++i) {
-    FontFace* f = mConnectedFaces[i].mFontFace;
+  for (uint32_t i = 0; i < mRuleFaces.Length(); ++i) {
+    FontFace* f = mRuleFaces[i].mFontFace;
     gfxUserFontEntry* entry = f->GetUserFontEntry();
     if (entry && entry->GetPlatformFontEntry() == aFontEntry) {
       return f->GetRule();
     }
   }
   return nullptr;
 }
 
 nsCSSFontFaceRule*
 FontFaceSet::FindRuleForUserFontEntry(gfxUserFontEntry* aUserFontEntry)
 {
-  for (uint32_t i = 0; i < mConnectedFaces.Length(); ++i) {
-    FontFace* f = mConnectedFaces[i].mFontFace;
+  for (uint32_t i = 0; i < mRuleFaces.Length(); ++i) {
+    FontFace* f = mRuleFaces[i].mFontFace;
     if (f->GetUserFontEntry() == aUserFontEntry) {
       return f->GetRule();
     }
   }
   return nullptr;
 }
 
 gfxUserFontEntry*
@@ -1272,42 +1271,42 @@ FontFaceSet::FontFaceForRule(nsCSSFontFa
     FontFace::CreateForRule(GetParentObject(), mPresContext, aRule, entry);
   aRule->SetFontFace(newFontFace);
   return newFontFace;
 }
 
 void
 FontFaceSet::AddUnavailableFontFace(FontFace* aFontFace)
 {
-  MOZ_ASSERT(!aFontFace->IsConnected());
+  MOZ_ASSERT(!aFontFace->HasRule());
   MOZ_ASSERT(!aFontFace->IsInFontFaceSet());
   MOZ_ASSERT(!mUnavailableFaces.Contains(aFontFace));
 
   mUnavailableFaces.AppendElement(aFontFace);
 }
 
 void
 FontFaceSet::RemoveUnavailableFontFace(FontFace* aFontFace)
 {
-  MOZ_ASSERT(!aFontFace->IsConnected());
+  MOZ_ASSERT(!aFontFace->HasRule());
   MOZ_ASSERT(!aFontFace->IsInFontFaceSet());
 
   // We might not actually find the FontFace in mUnavailableFaces, since we
   // might be shutting down the document and had DestroyUserFontSet called
   // on us, which clears out mUnavailableFaces.
   mUnavailableFaces.RemoveElement(aFontFace);
 
   MOZ_ASSERT(!mUnavailableFaces.Contains(aFontFace));
 }
 
 void
 FontFaceSet::OnFontFaceInitialized(FontFace* aFontFace)
 {
   MOZ_ASSERT(HasAvailableFontFace(aFontFace));
-  MOZ_ASSERT(!aFontFace->IsConnected());
+  MOZ_ASSERT(!aFontFace->HasRule());
   MOZ_ASSERT(aFontFace->IsInitialized());
 
   mPresContext->RebuildUserFontSet();
 }
 
 void
 FontFaceSet::OnFontFaceStatusChanged(FontFace* aFontFace)
 {
@@ -1354,25 +1353,25 @@ FontFaceSet::CheckLoadingStarted()
   }
 }
 
 void
 FontFaceSet::UpdateHasLoadingFontFaces()
 {
   mHasLoadingFontFacesIsDirty = false;
   mHasLoadingFontFaces = false;
-  for (size_t i = 0; i < mConnectedFaces.Length(); i++) {
-    FontFace* f = mConnectedFaces[i].mFontFace;
+  for (size_t i = 0; i < mRuleFaces.Length(); i++) {
+    FontFace* f = mRuleFaces[i].mFontFace;
     if (f->Status() == FontFaceLoadStatus::Loading) {
       mHasLoadingFontFaces = true;
       return;
     }
   }
-  for (size_t i = 0; i < mOtherFaces.Length(); i++) {
-    if (mOtherFaces[i]->Status() == FontFaceLoadStatus::Loading) {
+  for (size_t i = 0; i < mNonRuleFaces.Length(); i++) {
+    if (mNonRuleFaces[i]->Status() == FontFaceLoadStatus::Loading) {
       mHasLoadingFontFaces = true;
       return;
     }
   }
 }
 
 bool
 FontFaceSet::HasLoadingFontFaces()
@@ -1433,27 +1432,27 @@ FontFaceSet::CheckLoadingFinished()
     mReady->MaybeResolve(this);
     mReadyIsResolved = true;
   }
 
   // Now dispatch the loadingdone/loadingerror events.
   nsTArray<FontFace*> loaded;
   nsTArray<FontFace*> failed;
 
-  for (size_t i = 0; i < mConnectedFaces.Length(); i++) {
-    FontFace* f = mConnectedFaces[i].mFontFace;
+  for (size_t i = 0; i < mRuleFaces.Length(); i++) {
+    FontFace* f = mRuleFaces[i].mFontFace;
     if (f->Status() == FontFaceLoadStatus::Loaded) {
       loaded.AppendElement(f);
     } else if (f->Status() == FontFaceLoadStatus::Error) {
       failed.AppendElement(f);
     }
   }
 
-  for (size_t i = 0; i < mOtherFaces.Length(); i++) {
-    FontFace* f = mOtherFaces[i];
+  for (size_t i = 0; i < mNonRuleFaces.Length(); i++) {
+    FontFace* f = mNonRuleFaces[i];
     if (f->Status() == FontFaceLoadStatus::Loaded) {
       loaded.AppendElement(f);
     } else if (f->Status() == FontFaceLoadStatus::Error) {
       failed.AppendElement(f);
     }
   }
 
   DispatchLoadingFinishedEvent(NS_LITERAL_STRING("loadingdone"), loaded);
--- a/layout/style/FontFaceSet.h
+++ b/layout/style/FontFaceSet.h
@@ -253,23 +253,23 @@ private:
                             uint8_t*& aBuffer,
                             uint32_t& aBufferLength);
   nsresult LogMessage(gfxUserFontEntry* aUserFontEntry,
                       const char* aMessage,
                       uint32_t aFlags,
                       nsresult aStatus);
   void DoRebuildUserFontSet();
 
-  void InsertConnectedFontFace(FontFace* aFontFace, uint8_t aSheetType,
-                               nsTArray<FontFaceRecord>& aOldRecords,
-                               bool& aFontSetModified);
-  void InsertUnconnectedFontFace(FontFace* aFontFace, bool& aFontSetModified);
+  void InsertRuleFontFace(FontFace* aFontFace, uint8_t aSheetType,
+                          nsTArray<FontFaceRecord>& aOldRecords,
+                          bool& aFontSetModified);
+  void InsertNonRuleFontFace(FontFace* aFontFace, bool& aFontSetModified);
 
 #ifdef DEBUG
-  bool HasConnectedFontFace(FontFace* aFontFace);
+  bool HasRuleFontFace(FontFace* aFontFace);
 #endif
 
   /**
    * Returns whether we have any loading FontFace objects in the FontFaceSet.
    */
   bool HasLoadingFontFaces();
 
   // Helper function for HasLoadingFontFaces.
@@ -277,53 +277,53 @@ private:
 
   nsRefPtr<UserFontSet> mUserFontSet;
   nsPresContext* mPresContext;
 
   // The document this is a FontFaceSet for.
   nsCOMPtr<nsIDocument> mDocument;
 
   // A Promise that is fulfilled once all of the FontFace objects
-  // in mConnectedFaces and mOtherFaces that started or were loading at the
+  // in mRuleFaces and mNonRuleFaces that started or were loading at the
   // time the Promise was created have finished loading.  It is rejected if
   // any of those fonts failed to load.  mReady is replaced with
   // a new Promise object whenever mReady is settled and another
-  // FontFace in mConnectedFaces or mOtherFaces starts to load.
+  // FontFace in mRuleFaces or mNonRuleFaces starts to load.
   nsRefPtr<mozilla::dom::Promise> mReady;
 
   // Set of all loaders pointing to us. These are not strong pointers,
   // but that's OK because nsFontFaceLoader always calls RemoveLoader on
   // us before it dies (unless we die first).
   nsTHashtable< nsPtrHashKey<nsFontFaceLoader> > mLoaders;
 
-  // The CSS-connected FontFace objects in the FontFaceSet.
-  nsTArray<FontFaceRecord> mConnectedFaces;
+  // The @font-face rule backed FontFace objects in the FontFaceSet.
+  nsTArray<FontFaceRecord> mRuleFaces;
 
-  // The unconnected FontFace objects that have been added to this
+  // The non rule backed FontFace objects that have been added to this
   // FontFaceSet and their corresponding user font entries.
-  nsTArray<nsRefPtr<FontFace>> mOtherFaces;
+  nsTArray<nsRefPtr<FontFace>> mNonRuleFaces;
 
-  // The unconnected FontFace objects that have not been added to
+  // The non rule backed FontFace objects that have not been added to
   // this FontFaceSet.
   nsTArray<FontFace*> mUnavailableFaces;
 
   // The overall status of the loading or loaded fonts in the FontFaceSet.
   mozilla::dom::FontFaceSetLoadStatus mStatus;
 
-  // Whether mOtherFaces has changed since last time UpdateRules ran.
-  bool mOtherFacesDirty;
+  // Whether mNonRuleFaces has changed since last time UpdateRules ran.
+  bool mNonRuleFacesDirty;
 
   // Whether we have called MaybeResolve() on mReady.
   bool mReadyIsResolved;
 
   // Whether we have already dispatched loading events for the current set
   // of loading FontFaces.
   bool mDispatchedLoadingEvent;
 
-  // Whether any FontFace objects in mConnectedFaces or mOtherFaces are
+  // Whether any FontFace objects in mRuleFaces or mNonRuleFaces are
   // loading.  Only valid when mHasLoadingFontFacesIsDirty is false.  Don't use
   // this variable directly; call the HasLoadingFontFaces method instead.
   bool mHasLoadingFontFaces;
 
   // This variable is only valid when mLoadingDirty is false.
   bool mHasLoadingFontFacesIsDirty;
 };