Bug 1535384 part 10. Remove MOZ_CAN_RUN_SCRIPT_BOUNDARY for FontFaceSetForEachCallback. r=heycam
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 19 Mar 2019 04:36:18 +0000
changeset 465352 a2ff272ceb426e1d5051507354bc3d4d1bb2736d
parent 465351 4275dbf74afeb3c3e9c4d527294e964f8105adf6
child 465353 db29f053e54ef83da3e313de6e85f3b850faa543
push id112500
push userncsoregi@mozilla.com
push dateThu, 21 Mar 2019 10:53:17 +0000
treeherdermozilla-inbound@527e38b41c4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1535384, 1311198
milestone68.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
Bug 1535384 part 10. Remove MOZ_CAN_RUN_SCRIPT_BOUNDARY for FontFaceSetForEachCallback. r=heycam This code should all go away (bug 1311198), but in the meantime... Differential Revision: https://phabricator.services.mozilla.com/D23781
dom/webidl/FontFaceSet.webidl
layout/style/FontFaceSet.cpp
layout/style/FontFaceSet.h
--- a/dom/webidl/FontFaceSet.webidl
+++ b/dom/webidl/FontFaceSet.webidl
@@ -18,17 +18,16 @@ dictionary FontFaceSetIteratorResult
 };
 
 // To implement FontFaceSet's iterator until we can use setlike.
 [NoInterfaceObject]
 interface FontFaceSetIterator {
   [Throws] FontFaceSetIteratorResult next();
 };
 
-[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
 callback FontFaceSetForEachCallback = void (FontFace value, FontFace key, FontFaceSet set);
 
 enum FontFaceSetLoadStatus { "loading", "loaded" };
 
 // Bug 1072762 is for the FontFaceSet constructor.
 // [Constructor(sequence<FontFace> initialFaces)]
 [Pref="layout.css.font-loading-api.enabled"]
 interface FontFaceSet : EventTarget {
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -564,17 +564,17 @@ already_AddRefed<FontFaceSetIterator> Fo
   RefPtr<FontFaceSetIterator> it = new FontFaceSetIterator(this, false);
   return it.forget();
 }
 
 void FontFaceSet::ForEach(JSContext* aCx, FontFaceSetForEachCallback& aCallback,
                           JS::Handle<JS::Value> aThisArg, ErrorResult& aRv) {
   JS::Rooted<JS::Value> thisArg(aCx, aThisArg);
   for (size_t i = 0; i < Size(); i++) {
-    FontFace* face = GetFontFaceAt(i);
+    RefPtr<FontFace> face = GetFontFaceAt(i);
     aCallback.Call(thisArg, *face, *face, *this, aRv);
     if (aRv.Failed()) {
       return;
     }
   }
 }
 
 void FontFaceSet::RemoveLoader(nsFontFaceLoader* aLoader) {
--- a/layout/style/FontFaceSet.h
+++ b/layout/style/FontFaceSet.h
@@ -187,16 +187,17 @@ class FontFaceSet final : public DOMEven
 
   void Add(FontFace& aFontFace, mozilla::ErrorResult& aRv);
   void Clear();
   bool Delete(FontFace& aFontFace);
   bool Has(FontFace& aFontFace);
   uint32_t Size();
   already_AddRefed<mozilla::dom::FontFaceSetIterator> Entries();
   already_AddRefed<mozilla::dom::FontFaceSetIterator> Values();
+  MOZ_CAN_RUN_SCRIPT
   void ForEach(JSContext* aCx, FontFaceSetForEachCallback& aCallback,
                JS::Handle<JS::Value> aThisArg, mozilla::ErrorResult& aRv);
 
   // For ServoStyleSet to know ahead of time whether a font is loadable.
   void CacheFontLoadability();
 
  private:
   ~FontFaceSet();