Bug 1193019 - Rename CSSFontFaceLoadEvent to FontFaceSetLoadEvent. r=khuey

This commit is contained in:
Cameron McCormack 2015-08-11 12:19:52 +10:00
parent ebec0fbd23
commit a3b9091a65
7 changed files with 29 additions and 29 deletions

View File

@ -134,10 +134,6 @@ const kEventConstructors = {
return e;
},
},
CSSFontFaceLoadEvent: { create: function (aName, aProps) {
return new CSSFontFaceLoadEvent(aName, aProps);
},
},
CustomEvent: { create: function (aName, aProps) {
return new CustomEvent(aName, aProps);
},
@ -211,6 +207,10 @@ const kEventConstructors = {
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);
},

View File

@ -311,8 +311,6 @@ var interfaceNamesInGlobalScope =
"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!
@ -471,6 +469,8 @@ var interfaceNamesInGlobalScope =
"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!

View File

@ -10,12 +10,12 @@
* 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;
};

View File

@ -751,7 +751,6 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'CaretStateChangedEvent.webidl',
'CFStateChangeEvent.webidl',
'CloseEvent.webidl',
'CSSFontFaceLoadEvent.webidl',
'DataErrorEvent.webidl',
'DataStoreChangeEvent.webidl',
'DeviceLightEvent.webidl',
@ -763,6 +762,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'DownloadEvent.webidl',
'ErrorEvent.webidl',
'ExternalAppEvent.webidl',
'FontFaceSetLoadEvent.webidl',
'HashChangeEvent.webidl',
'IccChangeEvent.webidl',
'ImageCaptureErrorEvent.webidl',

View File

@ -9,10 +9,10 @@
#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"
@ -1624,7 +1624,7 @@ FontFaceSet::DispatchLoadingFinishedEvent(
const nsAString& aType,
const nsTArray<FontFace*>& aFontFaces)
{
CSSFontFaceLoadEventInit init;
FontFaceSetLoadEventInit init;
init.mBubbles = false;
init.mCancelable = false;
OwningNonNull<FontFace>* elements =
@ -1633,8 +1633,8 @@ FontFaceSet::DispatchLoadingFinishedEvent(
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();
}

View File

@ -215,7 +215,7 @@ private:
void CheckLoadingFinishedAfterDelay();
/**
* Dispatches a CSSFontFaceLoadEvent to this object.
* Dispatches a FontFaceSetLoadEvent to this object.
*/
void DispatchLoadingFinishedEvent(
const nsAString& aType,

View File

@ -184,9 +184,9 @@ function runTest() {
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() {
@ -651,15 +651,15 @@ function runTest() {
}
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();
};
@ -783,14 +783,14 @@ function runTest() {
};
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();
}
@ -848,7 +848,7 @@ function runTest() {
};
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();
};
@ -899,7 +899,7 @@ function runTest() {
};
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();
};