Bug 1193019 - Rename CSSFontFaceLoadEvent to FontFaceSetLoadEvent. r=khuey, a=sledru
authorCameron McCormack <cam@mcc.id.au>
Tue, 11 Aug 2015 12:19:52 +1000
changeset 288742 eb10f5d032197d1cbfef8bd33780d5227026f3a3
parent 288741 cfcd91bd5aa22a097c4f0d21f9f740fd557e5d37
child 288743 700a1000830032fd8f324b68200d9cb786ddefb0
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, sledru
bugs1193019
milestone42.0a2
Bug 1193019 - Rename CSSFontFaceLoadEvent to FontFaceSetLoadEvent. r=khuey, a=sledru
dom/events/test/test_all_synthetic_events.html
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/CSSFontFaceLoadEvent.webidl
dom/webidl/FontFaceSetLoadEvent.webidl
dom/webidl/moz.build
layout/style/FontFaceSet.cpp
layout/style/FontFaceSet.h
layout/style/test/test_font_loading_api.html
--- a/dom/events/test/test_all_synthetic_events.html
+++ b/dom/events/test/test_all_synthetic_events.html
@@ -129,20 +129,16 @@ const kEventConstructors = {
                                              },
   CompositionEvent:                          { create: function (aName, aProps) {
                                                          var e = document.createEvent("compositionevent");
                                                          e.initCompositionEvent(aName, aProps.bubbles, aProps.cancelable,
                                                                                 aProps.view, aProps.data, aProps.locale);
                                                          return e;
                                                        },
                                              },
-  CSSFontFaceLoadEvent:                      { create: function (aName, aProps) {
-                                                         return new CSSFontFaceLoadEvent(aName, aProps);
-                                                       },
-                                             },
   CustomEvent:                               { create: function (aName, aProps) {
                                                          return new CustomEvent(aName, aProps);
                                                        },
                                              },
   DataErrorEvent:                            { create: function (aName, aProps) {
                                                           return new DataErrorEvent(aName, aProps);
                                                        },
                                              },
@@ -206,16 +202,20 @@ const kEventConstructors = {
   ErrorEvent:                                { create: function (aName, aProps) {
                                                          return new ErrorEvent(aName, aProps);
                                                        },
   },
   FocusEvent:                                { create: function (aName, aProps) {
                                                          return new FocusEvent(aName, aProps);
                                                        },
                                              },
+  FontFaceSetLoadEvent:                      { create: function (aName, aProps) {
+                                                         return new FontFaceSetLoadEvent(aName, aProps);
+                                                       },
+                                             },
   GamepadEvent:                              { create: function (aName, aProps) {
                                                          return new GamepadEvent(aName, aProps);
                                                        },
                                              },
   GamepadAxisMoveEvent:                      { create: function (aName, aProps) {
                                                          return new GamepadAxisMoveEvent(aName, aProps);
                                                        },
                                              },
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -307,18 +307,16 @@ var interfaceNamesInGlobalScope =
     "CSS2Properties",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "CSSAnimation", release: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CSSConditionRule",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CSSCounterStyleRule",
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    "CSSFontFaceLoadEvent",
-// IMPORTANT: Do not change this list without review from a DOM peer!
     "CSSFontFaceRule",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CSSFontFeatureValuesRule",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CSSGroupingRule",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "CSSImportRule",
 // IMPORTANT: Do not change this list without review from a DOM peer!
@@ -467,16 +465,18 @@ var interfaceNamesInGlobalScope =
     "FocusEvent",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "FormData",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "FontFace",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "FontFaceSet",
 // IMPORTANT: Do not change this list without review from a DOM peer!
+    "FontFaceSetLoadEvent",
+// IMPORTANT: Do not change this list without review from a DOM peer!
     "GainNode",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "Gamepad", b2g: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "GamepadAxisMoveEvent", b2g: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "GamepadButtonEvent", b2g: false},
 // IMPORTANT: Do not change this list without review from a DOM peer!
rename from dom/webidl/CSSFontFaceLoadEvent.webidl
rename to dom/webidl/FontFaceSetLoadEvent.webidl
--- a/dom/webidl/CSSFontFaceLoadEvent.webidl
+++ b/dom/webidl/FontFaceSetLoadEvent.webidl
@@ -5,17 +5,17 @@
  *
  * The origin of this IDL file is
  * http://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
  *
  * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
-dictionary CSSFontFaceLoadEventInit : EventInit {
+dictionary FontFaceSetLoadEventInit : EventInit {
   sequence<FontFace> fontfaces = [];
 };
 
-[Constructor(DOMString type, optional CSSFontFaceLoadEventInit eventInitDict),
+[Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict),
  Pref="layout.css.font-loading-api.enabled"]
-interface CSSFontFaceLoadEvent : Event {
+interface FontFaceSetLoadEvent : Event {
   [Cached, Constant] readonly attribute sequence<FontFace> fontfaces;
 };
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -745,28 +745,28 @@ GENERATED_EVENTS_WEBIDL_FILES = [
     'CallGroupErrorEvent.webidl',
     'CameraClosedEvent.webidl',
     'CameraConfigurationEvent.webidl',
     'CameraFacesDetectedEvent.webidl',
     'CameraStateChangeEvent.webidl',
     'CaretStateChangedEvent.webidl',
     'CFStateChangeEvent.webidl',
     'CloseEvent.webidl',
-    'CSSFontFaceLoadEvent.webidl',
     'DataErrorEvent.webidl',
     'DataStoreChangeEvent.webidl',
     'DeviceLightEvent.webidl',
     'DeviceOrientationEvent.webidl',
     'DeviceProximityEvent.webidl',
     'DeviceStorageAreaChangedEvent.webidl',
     'DeviceStorageChangeEvent.webidl',
     'DOMTransactionEvent.webidl',
     'DownloadEvent.webidl',
     'ErrorEvent.webidl',
     'ExternalAppEvent.webidl',
+    'FontFaceSetLoadEvent.webidl',
     'HashChangeEvent.webidl',
     'IccChangeEvent.webidl',
     'ImageCaptureErrorEvent.webidl',
     'MediaStreamEvent.webidl',
     'MozApplicationEvent.webidl',
     'MozCellBroadcastEvent.webidl',
     'MozClirModeEvent.webidl',
     'MozContactChangeEvent.webidl',
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -4,20 +4,20 @@
  * 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 "FontFaceSet.h"
 
 #include "gfxFontConstants.h"
 #include "mozilla/css/Declaration.h"
 #include "mozilla/css/Loader.h"
-#include "mozilla/dom/CSSFontFaceLoadEvent.h"
-#include "mozilla/dom/CSSFontFaceLoadEventBinding.h"
 #include "mozilla/dom/FontFaceSetBinding.h"
 #include "mozilla/dom/FontFaceSetIterator.h"
+#include "mozilla/dom/FontFaceSetLoadEvent.h"
+#include "mozilla/dom/FontFaceSetLoadEventBinding.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Snprintf.h"
 #include "nsCORSListenerProxy.h"
 #include "nsCSSParser.h"
 #include "nsDeviceContext.h"
@@ -1619,27 +1619,27 @@ FontFaceSet::CheckLoadingFinished()
   }
 }
 
 void
 FontFaceSet::DispatchLoadingFinishedEvent(
                                  const nsAString& aType,
                                  const nsTArray<FontFace*>& aFontFaces)
 {
-  CSSFontFaceLoadEventInit init;
+  FontFaceSetLoadEventInit init;
   init.mBubbles = false;
   init.mCancelable = false;
   OwningNonNull<FontFace>* elements =
     init.mFontfaces.AppendElements(aFontFaces.Length(), fallible);
   MOZ_ASSERT(elements);
   for (size_t i = 0; i < aFontFaces.Length(); i++) {
     elements[i] = aFontFaces[i];
   }
-  nsRefPtr<CSSFontFaceLoadEvent> event =
-    CSSFontFaceLoadEvent::Constructor(this, aType, init);
+  nsRefPtr<FontFaceSetLoadEvent> event =
+    FontFaceSetLoadEvent::Constructor(this, aType, init);
   (new AsyncEventDispatcher(this, event))->RunDOMEventWhenSafe();
 }
 
 // nsIDOMEventListener
 
 NS_IMETHODIMP
 FontFaceSet::HandleEvent(nsIDOMEvent* aEvent)
 {
--- a/layout/style/FontFaceSet.h
+++ b/layout/style/FontFaceSet.h
@@ -210,17 +210,17 @@ private:
 
   /**
    * Callback for invoking CheckLoadingFinished after going through the
    * event loop.  See OnFontFaceStatusChanged.
    */
   void CheckLoadingFinishedAfterDelay();
 
   /**
-   * Dispatches a CSSFontFaceLoadEvent to this object.
+   * Dispatches a FontFaceSetLoadEvent to this object.
    */
   void DispatchLoadingFinishedEvent(
                                 const nsAString& aType,
                                 const nsTArray<FontFace*>& aFontFaces);
 
   // Note: if you add new cycle collected objects to FontFaceRecord,
   // make sure to update FontFaceSet's cycle collection macros
   // accordingly.
--- a/layout/style/test/test_font_loading_api.html
+++ b/layout/style/test/test_font_loading_api.html
@@ -179,19 +179,19 @@ function runTest() {
 
     // (TEST 1) Some miscellaneous tests for FontFaceSet and FontFace.
     ok(window.FontFaceSet, "FontFaceSet interface object should be present (TEST 1)");
     is(Object.getPrototypeOf(FontFaceSet.prototype), EventTarget.prototype, "FontFaceSet should inherit from EventTarget (TEST 1)");
     ok(document.fonts instanceof FontFaceSet, "document.fonts should be a a FontFaceSet (TEST 1)");
     ok(window.FontFace, "FontFace interface object should be present (TEST 1)");
     is(Object.getPrototypeOf(FontFace.prototype), Object.prototype, "FontFace should inherit from Object (TEST 1)");
 
-    // (TEST 2) Some miscellaneous tests for CSSFontFaceLoadEvent.
-    ok(window.CSSFontFaceLoadEvent, "CSSFontFaceLoadEvent interface object should be present (TEST 2)");
-    is(Object.getPrototypeOf(CSSFontFaceLoadEvent.prototype), Event.prototype, "CSSFontFaceLoadEvent should inherit from Event (TEST 2)");
+    // (TEST 2) Some miscellaneous tests for FontFaceSetLoadEvent.
+    ok(window.FontFaceSetLoadEvent, "FontFaceSetLoadEvent interface object should be present (TEST 2)");
+    is(Object.getPrototypeOf(FontFaceSetLoadEvent.prototype), Event.prototype, "FontFaceSetLoadEvent should inherit from Event (TEST 2)");
 
   }).then(function() {
 
     // (TEST 3) Test that document.fonts.ready starts out resolved with the
     // FontFaceSet.
     var p = Promise.resolve();
     [document, fdocument].forEach(function(doc) {
       p = p.then(function() {
@@ -646,25 +646,25 @@ function runTest() {
             doc.fonts.onloadingdone = null;
             doc.fonts.onloadingerror = null;
             doc.fonts.removeEventListener("loadingdone", doneListener);
             doc.fonts.removeEventListener("loadingerror", errorListener);
             aResolve();
           }
 
           var doneListener = function(aEvent) {
-            is(Object.getPrototypeOf(aEvent), win.CSSFontFaceLoadEvent.prototype, "loadingdone event should be a CSSFontFaceLoadEvent object (TEST 27) (" + win + ")");
-            is(aEvent.fontfaces.length, 0, "the CSSFontFaceLoadEvent should have an empty fontfaces array (TEST 27) (" + win + ")");
+            is(Object.getPrototypeOf(aEvent), win.FontFaceSetLoadEvent.prototype, "loadingdone event should be a FontFaceSetLoadEvent object (TEST 27) (" + win + ")");
+            is(aEvent.fontfaces.length, 0, "the FontFaceSetLoadEvent should have an empty fontfaces array (TEST 27) (" + win + ")");
             loadingdoneDispatched = true;
             check();
           };
           doc.fonts.addEventListener("loadingdone", doneListener);
           doc.fonts.onloadingdone = function(aEvent) {
-            is(Object.getPrototypeOf(aEvent), win.CSSFontFaceLoadEvent.prototype, "loadingdone event should be a CSSFontFaceLoadEvent object (TEST 27) (" + win + ")");
-            is(aEvent.fontfaces.length, 0, "the CSSFontFaceLoadEvent should have an empty fontfaces array (TEST 27) (" + win + ")");
+            is(Object.getPrototypeOf(aEvent), win.FontFaceSetLoadEvent.prototype, "loadingdone event should be a FontFaceSetLoadEvent object (TEST 27) (" + win + ")");
+            is(aEvent.fontfaces.length, 0, "the FontFaceSetLoadEvent should have an empty fontfaces array (TEST 27) (" + win + ")");
             onloadingdoneTriggered = true;
             check();
           };
           var errorListener = function(aEvent) {
             loadingerrorDispatched = true;
             check();
           }
           doc.fonts.addEventListener("loadingerror", errorListener);
@@ -778,24 +778,24 @@ function runTest() {
           }
 
           var doneListener = function(aEvent) {
             loadingdoneDispatched = true;
             check();
           };
           doc.fonts.addEventListener("loadingdone", doneListener);
           doc.fonts.onloadingdone = function(aEvent) {
-            is(Object.getPrototypeOf(aEvent), win.CSSFontFaceLoadEvent.prototype, "loadingdone event should be a CSSFontFaceLoadEvent object (TEST 29) (" + win + ")");
-            is(aEvent.fontfaces.length, 0, "the CSSFontFaceLoadEvent should have an empty fontfaces array (TEST 29) (" + win + ")");
+            is(Object.getPrototypeOf(aEvent), win.FontFaceSetLoadEvent.prototype, "loadingdone event should be a FontFaceSetLoadEvent object (TEST 29) (" + win + ")");
+            is(aEvent.fontfaces.length, 0, "the FontFaceSetLoadEvent should have an empty fontfaces array (TEST 29) (" + win + ")");
             onloadingdoneTriggered = true;
             check();
           };
           var errorListener = function(aEvent) {
-            is(Object.getPrototypeOf(aEvent), win.CSSFontFaceLoadEvent.prototype, "loadingerror event should be a CSSFontFaceLoadEvent object (TEST 29) (" + win + ")");
-            is(aEvent.fontfaces[0], face, "the CSSFontFaceLoadEvent should have a fontfaces array with the FontFace in it (TEST 29) (" + win + ")");
+            is(Object.getPrototypeOf(aEvent), win.FontFaceSetLoadEvent.prototype, "loadingerror event should be a FontFaceSetLoadEvent object (TEST 29) (" + win + ")");
+            is(aEvent.fontfaces[0], face, "the FontFaceSetLoadEvent should have a fontfaces array with the FontFace in it (TEST 29) (" + win + ")");
             loadingerrorDispatched = true;
             check();
           }
           doc.fonts.addEventListener("loadingerror", errorListener);
           doc.fonts.onloadingerror = function(aEvent) {
             onloadingerrorTriggered = true;
             check();
           };
@@ -843,17 +843,17 @@ function runTest() {
           }
 
           var doneListener = function(aEvent) {
             loadingdoneDispatched = true;
             check();
           };
           doc.fonts.addEventListener("loadingdone", doneListener);
           doc.fonts.onloadingdone = function(aEvent) {
-            is(aEvent.fontfaces[0], face, "the CSSFontFaceLoadEvent should have a fontfaces array with the FontFace in it (TEST 30) (" + win + ")");
+            is(aEvent.fontfaces[0], face, "the FontFaceSetLoadEvent should have a fontfaces array with the FontFace in it (TEST 30) (" + win + ")");
             onloadingdoneTriggered = true;
             check();
           };
         });
 
         face = new win.FontFace("test", "url(BitPattern.woff?test30." + i + ")");
         face.load();
         is(face.status, "loading", "FontFace should have status \"loading\" (TEST 30) (" + win + ")");
@@ -894,17 +894,17 @@ function runTest() {
           }
 
           var doneListener = function(aEvent) {
             loadingdoneDispatched = true;
             check();
           };
           doc.fonts.addEventListener("loadingdone", doneListener);
           doc.fonts.onloadingdone = function(aEvent) {
-            is(aEvent.fontfaces[0], face, "the CSSFontFaceLoadEvent should have a fontfaces array with the FontFace in it (TEST 31) (" + win + ")");
+            is(aEvent.fontfaces[0], face, "the FontFaceSetLoadEvent should have a fontfaces array with the FontFace in it (TEST 31) (" + win + ")");
             onloadingdoneTriggered = true;
             check();
           };
         });
 
         face = new win.FontFace("test", "url(BitPattern.woff?test31." + i + ")");
         is(face.status, "unloaded", "FontFace should have status \"unloaded\" (TEST 31) (" + win + ")");
         doc.fonts.add(face);