Backed out 12 changesets (bug 1356103) for build bustage at PostTraversalTask.h
authorIris Hsiao <ihsiao@mozilla.com>
Thu, 04 May 2017 17:56:25 +0800
changeset 356477 8f8cb62a874903f66603da14326bfc52326c30f9
parent 356476 366d1dc1f33e55c6b4c93c1ef0ebe4834c3c9df6
child 356478 6fa5520670a334c592e83d19305b0b83933ba9bc
push id31767
push usercbook@mozilla.com
push dateFri, 05 May 2017 13:15:58 +0000
treeherdermozilla-central@8872ad4d52b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1356103
milestone55.0a1
backs out9fb487252c28320a1ba42f7919fa852fbea76446
301237c659450c31674defb177895b9aabc23a42
7bc3a4861a3995638bc2dada3cc8f2257b887342
2f383d89184b02533e9afbfa4d614db064e0b2c6
a03112e1c9d5597e91b48d94a49d62890a33d298
c60b4c9cbd83e774eca3014e1e0d78f67b055b62
34280baeaabe27be2c7d587b6e1875d260bdbcdf
31a0881cfb4714a43c725d114775f1b9061d81f4
529d037f9c3361be19480d26054b4a790c2aafdd
1c7831db6b0750720a5bc617cf56804525fd18f2
559f06e32df3a9412095f1000770ac915dfc3777
784865d234cdb3822745cdddc0e0422d94a17c04
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
Backed out 12 changesets (bug 1356103) for build bustage at PostTraversalTask.h Backed out changeset 9fb487252c28 (bug 1356103) Backed out changeset 301237c65945 (bug 1356103) Backed out changeset 7bc3a4861a39 (bug 1356103) Backed out changeset 2f383d89184b (bug 1356103) Backed out changeset a03112e1c9d5 (bug 1356103) Backed out changeset c60b4c9cbd83 (bug 1356103) Backed out changeset 34280baeaabe (bug 1356103) Backed out changeset 31a0881cfb47 (bug 1356103) Backed out changeset 529d037f9c33 (bug 1356103) Backed out changeset 1c7831db6b07 (bug 1356103) Backed out changeset 559f06e32df3 (bug 1356103) Backed out changeset 784865d234cd (bug 1356103)
gfx/2d/2D.h
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxUserFontSet.cpp
gfx/thebes/gfxUserFontSet.h
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
layout/reftests/bidi/reftest.list
layout/reftests/border-radius/reftest.list
layout/reftests/bugs/reftest.list
layout/reftests/columns/reftest.list
layout/reftests/forms/fieldset/reftest.list
layout/reftests/mathml/reftest.list
layout/reftests/svg/svg-integration/clip-path/reftest.list
layout/reftests/text-overflow/reftest.list
layout/reftests/text/reftest.list
layout/reftests/w3c-css/failures.list
layout/reftests/w3c-css/received/reftest.list
layout/reftests/w3c-css/submitted/text3/reftest.list
layout/style/FontFace.cpp
layout/style/FontFace.h
layout/style/FontFaceSet.cpp
layout/style/FontFaceSet.h
layout/style/PostTraversalTask.cpp
layout/style/PostTraversalTask.h
layout/style/ServoBindings.cpp
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
layout/style/ServoUtils.h
layout/style/moz.build
mfbt/WeakPtr.h
parser/htmlparser/tests/reftest/reftest.list
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -21,17 +21,16 @@
 // to be able to hold on to a GLContext.
 #include "mozilla/GenericRefCounted.h"
 #include "mozilla/MemoryReporting.h"
 
 // This RefPtr class isn't ideal for usage in Azure, as it doesn't allow T**
 // outparams using the &-operator. But it will have to do as there's no easy
 // solution.
 #include "mozilla/RefPtr.h"
-#include "mozilla/ServoUtils.h"
 #include "mozilla/WeakPtr.h"
 
 #include "mozilla/DebugOnly.h"
 
 #ifdef MOZ_ENABLE_FREETYPE
 #include <string>
 #endif
 
@@ -59,33 +58,16 @@ class SkCanvas;
 struct gfxFontStyle;
 
 struct CGContext;
 typedef struct CGContext *CGContextRef;
 
 namespace mozilla {
 
 namespace gfx {
-class UnscaledFont;
-}
-
-template<>
-struct WeakPtrTraits<gfx::UnscaledFont>
-{
-  static void AssertSafeToAccessFromNonOwningThread()
-  {
-    // We want to allow UnscaledFont objects that were created on the main
-    // thread to be accessed from other threads if the Servo font metrics
-    // mutex is locked, and for objects created on Servo style worker threads
-    // to be accessed later back on the main thread.
-    AssertIsMainThreadOrServoFontMetricsLocked();
-  }
-};
-
-namespace gfx {
 
 class ScaledFont;
 class SourceSurface;
 class DataSourceSurface;
 class DrawTarget;
 class DrawEventRecorder;
 class FilterNode;
 class LogForwarder;
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -1952,17 +1952,16 @@ gfxFontGroup::GetFontAt(int32_t i, uint3
 void
 gfxFontGroup::FamilyFace::CheckState(bool& aSkipDrawing)
 {
     gfxFontEntry* fe = FontEntry();
     if (fe->mIsUserFontContainer) {
         gfxUserFontEntry* ufe = static_cast<gfxUserFontEntry*>(fe);
         gfxUserFontEntry::UserFontLoadState state = ufe->LoadState();
         switch (state) {
-            case gfxUserFontEntry::STATUS_LOAD_PENDING:
             case gfxUserFontEntry::STATUS_LOADING:
                 SetLoading(true);
                 break;
             case gfxUserFontEntry::STATUS_FAILED:
                 SetInvalid();
                 // fall-thru to the default case
                 MOZ_FALLTHROUGH;
             default:
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -16,18 +16,16 @@
 #include "nsIPrincipal.h"
 #include "nsIZipReader.h"
 #include "gfxFontConstants.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/gfx/2D.h"
 #include "gfxPlatformFontList.h"
-#include "mozilla/ServoStyleSet.h"
-#include "mozilla/PostTraversalTask.h"
 
 #include "opentype-sanitiser.h"
 #include "ots-memory-stream.h"
 
 using namespace mozilla;
 
 mozilla::LogModule*
 gfxUserFontSet::GetUserFontsLog()
@@ -138,20 +136,16 @@ gfxUserFontEntry::gfxUserFontEntry(gfxUs
 
     if (aUnicodeRanges) {
         mCharacterMap = new gfxCharacterMap(*aUnicodeRanges);
     }
 }
 
 gfxUserFontEntry::~gfxUserFontEntry()
 {
-    // Assert that we don't drop any gfxUserFontEntry objects during a Servo
-    // traversal, since PostTraversalTask objects can hold raw pointers to
-    // gfxUserFontEntry objects.
-    MOZ_ASSERT(!ServoStyleSet::IsInServoTraversal());
 }
 
 bool
 gfxUserFontEntry::Matches(const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
                           uint32_t aWeight,
                           int32_t aStretch,
                           uint8_t aStyle,
                           const nsTArray<gfxFontFeature>& aFeatureSettings,
@@ -430,52 +424,36 @@ CopyWOFFMetadata(const uint8_t* aFontDat
     }
     memcpy(aMetadata->Elements(), aFontData + metaOffset, metaCompLen);
     *aMetaOrigLen = woff->metaOrigLen;
 }
 
 void
 gfxUserFontEntry::LoadNextSrc()
 {
-    NS_ASSERTION(mSrcIndex < mSrcList.Length(),
+    uint32_t numSrc = mSrcList.Length();
+
+    NS_ASSERTION(mSrcIndex < numSrc,
                  "already at the end of the src list for user font");
     NS_ASSERTION((mUserFontLoadState == STATUS_NOT_LOADED ||
-                  mUserFontLoadState == STATUS_LOAD_PENDING ||
                   mUserFontLoadState == STATUS_LOADING) &&
                  mFontDataLoadingState < LOADING_FAILED,
                  "attempting to load a font that has either completed or failed");
 
     if (mUserFontLoadState == STATUS_NOT_LOADED) {
         SetLoadState(STATUS_LOADING);
         mFontDataLoadingState = LOADING_STARTED;
         mUnsupportedFormat = false;
     } else {
         // we were already loading; move to the next source,
         // but don't reset state - if we've already timed out,
         // that counts against the new download
         mSrcIndex++;
     }
 
-    DoLoadNextSrc(false);
-}
-
-void
-gfxUserFontEntry::ContinueLoad()
-{
-    MOZ_ASSERT(mUserFontLoadState == STATUS_LOAD_PENDING);
-    MOZ_ASSERT(mSrcList[mSrcIndex].mSourceType == gfxFontFaceSrc::eSourceType_URL);
-
-    DoLoadNextSrc(true);
-}
-
-void
-gfxUserFontEntry::DoLoadNextSrc(bool aForceAsync)
-{
-    uint32_t numSrc = mSrcList.Length();
-
     // load each src entry in turn, until a local face is found
     // or a download begins successfully
     while (mSrcIndex < numSrc) {
         gfxFontFaceSrc& currSrc = mSrcList[mSrcIndex];
 
         // src local ==> lookup and load immediately
 
         if (currSrc.mSourceType == gfxFontFaceSrc::eSourceType_Local) {
@@ -521,22 +499,16 @@ gfxUserFontEntry::DoLoadNextSrc(bool aFo
             }
         }
 
         // src url ==> start the load process
         else if (currSrc.mSourceType == gfxFontFaceSrc::eSourceType_URL) {
             if (gfxPlatform::GetPlatform()->IsFontFormatSupported(currSrc.mURI,
                     currSrc.mFormatFlags)) {
 
-                if (ServoStyleSet* set = ServoStyleSet::Current()) {
-                    set->AppendTask(PostTraversalTask::LoadFontEntry(this));
-                    SetLoadState(STATUS_LOAD_PENDING);
-                    return;
-                }
-
                 nsIPrincipal* principal = nullptr;
                 bool bypassCache;
                 nsresult rv = mFontSet->CheckFontLoad(&currSrc, &principal,
                                                       &bypassCache);
 
                 if (NS_SUCCEEDED(rv) && principal != nullptr) {
                     if (!bypassCache) {
                         // see if we have an existing entry for this source
@@ -560,21 +532,19 @@ gfxUserFontEntry::DoLoadNextSrc(bool aFo
                     }
 
                     // record the principal returned by CheckFontLoad,
                     // for use when creating a channel
                     // and when caching the loaded entry
                     mPrincipal = principal;
 
                     bool loadDoesntSpin = false;
-                    if (!aForceAsync) {
-                        rv = NS_URIChainHasFlags(currSrc.mURI,
-                               nsIProtocolHandler::URI_SYNC_LOAD_IS_OK,
-                               &loadDoesntSpin);
-                    }
+                    rv = NS_URIChainHasFlags(currSrc.mURI,
+                           nsIProtocolHandler::URI_SYNC_LOAD_IS_OK,
+                           &loadDoesntSpin);
 
                     if (NS_SUCCEEDED(rv) && loadDoesntSpin) {
                         uint8_t* buffer = nullptr;
                         uint32_t bufferLength = 0;
 
                         // sync load font immediately
                         rv = mFontSet->SyncLoadFontData(this, &currSrc, buffer,
                                                         bufferLength);
@@ -669,17 +639,16 @@ gfxUserFontEntry::SetLoadState(UserFontL
 }
 
 MOZ_DEFINE_MALLOC_SIZE_OF_ON_ALLOC(UserFontMallocSizeOfOnAlloc)
 
 bool
 gfxUserFontEntry::LoadPlatformFont(const uint8_t* aFontData, uint32_t& aLength)
 {
     NS_ASSERTION((mUserFontLoadState == STATUS_NOT_LOADED ||
-                  mUserFontLoadState == STATUS_LOAD_PENDING ||
                   mUserFontLoadState == STATUS_LOADING) &&
                  mFontDataLoadingState < LOADING_FAILED,
                  "attempting to load a font that has either completed or failed");
 
     gfxFontEntry* fe = nullptr;
 
     gfxUserFontType fontType =
         gfxFontUtils::DetermineFontDataType(aFontData, aLength);
--- a/gfx/thebes/gfxUserFontSet.h
+++ b/gfx/thebes/gfxUserFontSet.h
@@ -12,19 +12,16 @@
 #include "nsCOMPtr.h"
 #include "nsIURI.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptError.h"
 #include "nsURIHashKey.h"
 #include "mozilla/net/ReferrerPolicy.h"
 #include "gfxFontConstants.h"
 
-namespace mozilla {
-class PostTraversalTask;
-} // namespace mozilla
 class nsFontFaceLoader;
 
 //#define DEBUG_USERFONT_CACHE
 
 class gfxFontFaceBufferSource
 {
   NS_INLINE_DECL_REFCOUNTING(gfxFontFaceBufferSource)
 public:
@@ -173,17 +170,17 @@ class gfxUserFontEntry;
 class gfxOTSContext;
 
 class gfxUserFontSet {
     friend class gfxUserFontEntry;
     friend class gfxOTSContext;
 
 public:
 
-    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(gfxUserFontSet)
+    NS_INLINE_DECL_REFCOUNTING(gfxUserFontSet)
 
     gfxUserFontSet();
 
     enum {
         // no flags ==> no hint set
         // unknown ==> unknown format hint set
         FLAG_FORMAT_UNKNOWN        = 1,
         FLAG_FORMAT_OPENTYPE       = 1 << 1,
@@ -546,26 +543,24 @@ protected:
     // performance stats
     uint32_t mDownloadCount;
     uint64_t mDownloadSize;
 };
 
 // acts a placeholder until the real font is downloaded
 
 class gfxUserFontEntry : public gfxFontEntry {
-    friend class mozilla::PostTraversalTask;
     friend class gfxUserFontSet;
     friend class nsUserFontSet;
     friend class nsFontFaceLoader;
     friend class gfxOTSContext;
 
 public:
     enum UserFontLoadState {
         STATUS_NOT_LOADED = 0,
-        STATUS_LOAD_PENDING,
         STATUS_LOADING,
         STATUS_LOADED,
         STATUS_FAILED
     };
 
     gfxUserFontEntry(gfxUserFontSet* aFontSet,
                      const nsTArray<gfxFontFaceSrc>& aFontFaceSrcList,
                      uint32_t aWeight,
@@ -593,18 +588,17 @@ public:
 
     gfxFontEntry* GetPlatformFontEntry() const { return mPlatformFontEntry; }
 
     // is the font loading or loaded, or did it fail?
     UserFontLoadState LoadState() const { return mUserFontLoadState; }
 
     // whether to wait before using fallback font or not
     bool WaitForUserFont() const {
-        return (mUserFontLoadState == STATUS_LOAD_PENDING ||
-                mUserFontLoadState == STATUS_LOADING) &&
+        return mUserFontLoadState == STATUS_LOADING &&
                mFontDataLoadingState < LOADING_SLOWLY;
     }
 
     // for userfonts, cmap is used to store the unicode range data
     // no cmap ==> all codepoints permitted
     bool CharacterInUnicodeRange(uint32_t ch) const {
         if (mCharacterMap) {
             return mCharacterMap->test(ch);
@@ -634,18 +628,16 @@ public:
 protected:
     const uint8_t* SanitizeOpenTypeData(const uint8_t* aData,
                                         uint32_t aLength,
                                         uint32_t& aSaneLength,
                                         gfxUserFontType aFontType);
 
     // attempt to load the next resource in the src list.
     void LoadNextSrc();
-    void ContinueLoad();
-    void DoLoadNextSrc(bool aForceAsync);
 
     // change the load state
     virtual void SetLoadState(UserFontLoadState aLoadState);
 
     // when download has been completed, pass back data here
     // aDownloadStatus == NS_OK ==> download succeeded, error otherwise
     // returns true if platform font creation sucessful (or local()
     // reference was next in line)
--- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
+++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
@@ -320,18 +320,17 @@ function ignoreCallEdge(entry, callee)
     // (possibly to another). Writes on the origin thread are ok.
     if (/::SetName/.test(callee) &&
         /::UnlabeledDispatch/.test(name))
     {
         return true;
     }
 
     // We manually lock here
-    if (name == "Gecko_nsFont_InitSystem" ||
-        name == "Gecko_GetFontMetrics")
+    if ("Gecko_nsFont_InitSystem" == name)
     {
         return true;
     }
 
     return false;
 }
 
 function ignoreContents(entry)
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -76,33 +76,33 @@ fails-if(stylo) == 263359-2.html 263359-
 == 263359-3.html 263359-3-ref.html
 == 263359-4.html 263359-4-ref.html
 random-if(winWidget) fuzzy-if(skiaContent,1,1700) fails-if(stylo) == 267459-1.html 267459-1-ref.html # depends on windows version, see bug 590101
 fuzzy-if(skiaContent,1,1100) fails-if(stylo) == 267459-2.html 267459-2-ref.html
 == 299065-1.html 299065-1-ref.html
 random-if(winWidget) == 305643-1.html 305643-1-ref.html # depends on windows version, see bug 590101
 == 332655-1.html 332655-1-ref.html
 == 332655-2.html 332655-2-ref.html
-== 381279-1.html 381279-1-ref.html
+fails-if(stylo) == 381279-1.html 381279-1-ref.html
 == 386339.html 386339-ref.html
 == 409375.html 409375-ref.html
 == 413542-1.html 413542-1-ref.html
 == 413542-2.html 413542-2-ref.html
 fails-if(stylo) == 413928-1.html 413928-1-ref.html
 fails-if(stylo) == 413928-2.html 413928-2-ref.html
 == 425338-1a.html 425338-1-ref.html
 == 425338-1b.html 425338-1-ref.html
 == 489517-1.html 489517-1-ref.html
 == 489887-1.html 489887-1-ref.html
 == 492231-1.html 492231-1-ref.html
 == 496006-1.html 496006-1-ref.html
 == 503269-1.html 503269-1-ref.html
 == 503957-1.html 503957-1-ref.html
 == 525740-1.html 525740-1-ref.html
-== 536963-1.html 536963-1-ref.html
+fails-if(stylo) == 536963-1.html 536963-1-ref.html
 == 562169-1.html 562169-1-ref.html
 fails-if(stylo) == 562169-1a.html 562169-1-ref.html
 == 562169-2.html 562169-2-ref.html
 fails-if(stylo) == 562169-2a.html 562169-2-ref.html
 == 562169-3.html 562169-3-ref.html
 fails-if(stylo) == 562169-3a.html 562169-3-ref.html
 == 562169-4.html 562169-4-ref.html
 == 588739-1.html 588739-ref.html
--- a/layout/reftests/border-radius/reftest.list
+++ b/layout/reftests/border-radius/reftest.list
@@ -9,17 +9,17 @@
 
 != outline-square.html about:blank
 != outline-circle.html about:blank
 != outline-ellips.html about:blank
 != outline-square.html outline-circle.html
 != outline-square.html outline-ellips.html
 != outline-circle.html outline-ellips.html
 == border-value-interpret.html border-value-interpret-ref.html
-!= curved-borders-all-styles.html about:blank # no way to generate reference for dotted/dashed/inset/outset
+fails-if(stylo) != curved-borders-all-styles.html about:blank # no way to generate reference for dotted/dashed/inset/outset
 # ridge/groove borders
 
 # percent units
 == percent-1.html percent-1-ref.html
 fuzzy-if(skiaContent,1,342) == percent-2.html percent-2-ref.html
 fuzzy-if(skiaContent,1,343) == percent-3.html percent-3-ref.html
 
 # more serious tests, using SVG reference
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -442,35 +442,35 @@ random == 328829-1.xhtml 328829-1-ref.xh
 == 334829-1a.xhtml 334829-1-ref.xhtml
 == 334829-1b.xhtml 334829-1-ref.xhtml
 fails-if(stylo) == 335628-1.html 335628-1-ref.html
 != 335628-2.xul 335628-2-ref.xul
 == 336096-1.xul 336096-1-ref.xul
 fails-if(stylo) == 336147-1.html 336147-1-ref.html
 == 336153-1.html 336153-1-ref.html
 != 338251-p.html about:blank
-== 338251-p-oh.html 338251-p-oh-ref.html
+fails-if(stylo) == 338251-p-oh.html 338251-p-oh-ref.html
 != 338251-pre.html about:blank
-== 338251-pre-oh.html 338251-pre-oh-ref.html
+fails-if(stylo) == 338251-pre-oh.html 338251-pre-oh-ref.html
 fuzzy-if(skiaContent,2,3) == 339289-1.html 339289-1-ref.html
 == 341043-1a.html 341043-1-ref.html
 != 341043-1b.html 341043-1-ref.html
 == 343538-1.html 343538-1-ref.html
 == 343540-1.html 343540-1-ref.html
 fails-if(stylo) == 345267-1a.html 345267-1-ref.html
 fails-if(stylo) == 345267-1b.html 345267-1-ref.html
 fails-if(stylo) == 345267-1c.html 345267-1-ref.html
 fails-if(stylo) == 345267-1d.html 345267-1-ref.html
 != 345563-sub.xhtml 345563-sup.xhtml
 == 346189-1.xul 346189-1-ref.xul
 fuzzy-if(skiaContent,4,2) fails-if(stylo) == 346774-1a.html 346774-1-ref.html
 fuzzy-if(skiaContent,4,2) fails-if(stylo) == 346774-1b.html 346774-1-ref.html
 fuzzy-if(skiaContent,4,2) fails-if(stylo) == 346774-1c.html 346774-1-ref.html
 == 347348-1.xhtml 347348-1-ref.xhtml
-== 347496-1.xhtml 347496-1-ref.xhtml
+fails-if(stylo) == 347496-1.xhtml 347496-1-ref.xhtml
 == 347912-1.html 347912-1-ref.html
 fails-if(stylo) == 348049-1.xhtml 348049-1-ref.xhtml
 fails-if(stylo) == 348516-1.html 348516-1-ref.html
 fails-if(stylo) == 348516-2.html 348516-2-ref.html
 fails-if(stylo) != 348516-2.html 348516-2-notref.html
 fails-if(stylo) != 348516-3.html 348516-3-notref.html
 == 348597-1.html 348597-ref.html
 == 348809-1a.html 348809-1-ref.html
@@ -544,18 +544,18 @@ fails-if(stylo) != 359903-1.html 359903-
 fuzzy-if(skiaContent,2,4) == 362594-2c.html 362594-2-standards-ref.html
 == 362901-1.html 362901-1-ref.html
 == 363247-1.html 363247-1-ref.html
 == 363329-1.html 363329-1-ref.html
 == 363329-2.html 363329-2-ref.html
 == 363370-1.html 363370-1-ref.html
 == 363402-1.html 363402-1-ref.html
 == 363637-1.html 363637-1-ref.html
-skip-if(Android) == 363706-1.html 363706-1-ref.html
-!= 363706-1.html about:blank
+skip-if(Android) fails-if(stylo) == 363706-1.html 363706-1-ref.html
+fails-if(stylo) != 363706-1.html about:blank
 fails-if(stylo) == 363728-1.html 363728-1-ref.html
 == 363728-2.html 363728-2-ref.html
 fuzzy-if(skiaContent||Android,4,11) fails-if(stylo) == 363858-1.html 363858-1-ref.html
 == 363858-2.html 363858-2-ref.html
 fails-if(stylo) == 363858-3.html 363858-3-ref.html
 == 363858-4.html 363858-4-ref.html
 fuzzy-if(OSX,45,2) fuzzy-if(winWidget,114,1) fails-if(stylo) == 363858-5a.html 363858-5-ref.html
 fails-if(stylo) == 363858-5b.html 363858-5-ref.html
@@ -636,17 +636,17 @@ fails-if(stylo) == 370422-1.html 370422-
 == 370525-rowspan-3.html 370525-rowspan-3-ref.html
 == 370525-rowspan-4.html 370525-rowspan-4-ref.html
 == 370525-sib.html 370525-sib-ref.html
 == 370586-1.xhtml 370586-1-ref.xhtml
 == 370629-1.html 370629-1-ref.html
 == 370629-2.html 370629-2-ref.html
 == 370692-1.xhtml 370692-1-ref.xhtml
 == 371041-1.html 371041-1-ref.html
-== 371043-1.html 371043-1-ref.html
+fails-if(stylo) == 371043-1.html 371043-1-ref.html
 == 371354-1.html 371354-1-ref.html
 == 371483-1.html about:blank # assertion test
 fails-if(Android&&!asyncPan) == 371561-1.html 371561-1-ref.html
 != 371681-1.xhtml about:blank
 == 371925-1a.html 371925-1-ref.html
 == 371925-1b.html 371925-1-ref.html
 == 372037-1.html 372037-1-ref.html
 == 372062-1.html 372062-1-ref.html
@@ -781,18 +781,18 @@ fails-if(!stylo) == 387344-1.html 387344
 == 390318-1c.html 390318-1-ref.html
 == 390318-1d.html 390318-1-ref.html
 == 390318-1e.html 390318-1-ref.html
 == 390318-1f.html 390318-1-ref.html
 skip-if(!winWidget) == 391045.html 391045-ref.html # windows-specific Uniscribe bug, trailing period is matched against different fonts on Mac/Linux (see 396137)
 == 391140-1.html 391140-1-ref.html
 == 391412-1a.html 391412-1-ref.html
 == 391412-1b.html 391412-1-ref.html
-== 391909-1.html 391909-1-ref.html
-skip-if(Android) == 391979.html 391979-ref.html
+fails-if(stylo) == 391909-1.html 391909-1-ref.html
+skip-if(Android) fails-if(stylo) == 391979.html 391979-ref.html
 fails-if(stylo) == 391994-1.html 391994-1-ref.html
 == 392047.html 392047-ref.html
 fails-if(stylo) == 392435-1.html 392435-1-ref.html
 == 393330-1.html 393330-1-ref.html
 == 393490-1.html 393490-1-ref.html
 == 393517-1.xhtml about:blank  # crash test
 fuzzy-if(skiaContent,1,600) == 393649-1.html 393649-1-ref.html
 == 393655-1.html 393655-1-ref.html
@@ -816,17 +816,17 @@ fails-if(stylo) == 395107-5.html 395107-
 fails-if(stylo) == 395130-1.html 395130-1-ref.html
 fails-if(stylo) == 395130-2.html 395130-2-ref.html
 == 395331-1.xml 395331-1-ref.xml
 == 395390-1.html 395390-1-ref.html
 == 396286-1.html about:blank  # crash test
 fuzzy-if(Android,5,283) == 397428-1.html 397428-1-ref.html
 == 397844-1.xhtml 397844-1-ref.xhtml
 == 398092-1.html 398092-1-ref.html
-== 398101-1.html 398101-1-ref.html
+fails-if(stylo) == 398101-1.html 398101-1-ref.html
 == 398144-1.html 398144-1-ref.html
 fuzzy-if(skiaContent,2,21) == 398682-1.html 398682-1-ref.html
 == 398797-1a.html 398797-1-ref.html
 == 398797-1b.html 398797-1-ref.html
 == 398797-1c.html 398797-1-ref.html
 == 398797-1d.html 398797-1-ref.html
 == 399209-1.html 399209-1-ref.html
 == 399209-2.html 399209-2-ref.html
@@ -1190,17 +1190,17 @@ test-pref(dom.use_xbl_scopes_for_remote_
 == 451876-2.html 451876-2-ref.html
 == 452915-1.html 452915-1-ref.html
 == 452964-1.html 452964-1-ref.html
 == 454361.html about:blank
 == 455105-1.html 455105-ref.html
 == 455105-2.html 455105-ref.html
 == 455171-5.html 455171-5-ref.html
 == 455280-1.xhtml 455280-1-ref.xhtml
-== 455826-1.html 455826-1-ref.html
+fails-if(stylo) == 455826-1.html 455826-1-ref.html
 fails-if(cocoaWidget) fails-if(Android) == 456147.xul 456147-ref.html # bug 458047
 fuzzy-if(Android,11,41) fuzzy-if(winWidget||gtkWidget,4,6) fuzzy-if(d2d,4,69) == 456219-1a.html 456219-1-ref.html # bug 1128229
 fuzzy-if(Android,11,41) fuzzy-if(winWidget||gtkWidget,4,6) fuzzy-if(d2d,4,69) == 456219-1b.html 456219-1-ref.html # bug 1128229
 fuzzy-if(Android,11,41) fuzzy-if(winWidget||gtkWidget,4,6) fuzzy-if(d2d,4,69) == 456219-1c.html 456219-1-ref.html # bug 1128229
 fuzzy-if(skiaContent,1,45) == 456219-2.html 456219-2-ref.html
 fails-if(stylo) == 456330-1.gif 456330-1-ref.png
 == 456484-1.html 456484-1-ref.html
 == 457398-1.html 457398-1-ref.html
@@ -1239,17 +1239,17 @@ fuzzy-if(skiaContent,1,12000) == 461512-
 == 464811-1.html 464811-1-ref.html
 == 465574-1.html 465574-1-ref.html # bug 421436
 == 466258-1.html 466258-1-ref.html
 == 466395-1.html 466395-1-ref.html
 == 466395-2.html 466395-2-ref.html
 fails-if(stylo) == 467084-1.html 467084-1-ref.html
 fails-if(stylo) == 467084-2.html 467084-2-ref.html
 == 467444-1.html 467444-1-ref.html
-== 467460-1.html 467460-1-ref.html
+fails-if(stylo) == 467460-1.html 467460-1-ref.html
 == 468473-1.xul 468473-1-ref.xul
 fails-if(stylo) == 468546-1.xhtml 468546-1-ref.xhtml
 == 471356-1.html 471356-1-ref.html
 == 471594-1.xhtml 471594-1-ref.html
 fuzzy(255,15) == 472020-1a.xul 472020-1-ref.xul
 fails-if(!stylo) == 472020-1b.xul 472020-1-ref.xul
 fails-if(!stylo) == 472020-2.xul 472020-2-ref.xul
 == 472500-1.xul 472500-1-ref.xul
--- a/layout/reftests/columns/reftest.list
+++ b/layout/reftests/columns/reftest.list
@@ -24,17 +24,17 @@ HTTP(..) == columnfill-auto-2.html colum
 HTTP(..) == columnfill-auto-3.html columnfill-auto-2-ref.html
 == columnrule-basic.html columnrule-basic-ref.html
 == columnrule-complex.html columnrule-complex-ref.html
 != columnrule-linestyles.html columnrule-linestyles-notref.html
 == columnrule-padding.html columnrule-padding-ref.html
 == columnfill-overflow.html columnfill-overflow-ref.html
 == margin-collapsing-bug616722-1.html margin-collapsing-bug616722-1-ref.html
 == margin-collapsing-bug616722-2.html margin-collapsing-bug616722-2-ref.html
-== column-balancing-nested-000.html column-balancing-nested-000-ref.html
-== column-balancing-nested-001.html column-balancing-nested-001-ref.html
+fails-if(stylo) == column-balancing-nested-000.html column-balancing-nested-000-ref.html
+fails-if(stylo) == column-balancing-nested-001.html column-balancing-nested-001-ref.html
 == columnrule-overflow.html columnrule-overflow-ref.html
 == columns-table-caption-000.html columns-table-caption-000-ref.html
 == positioning-transforms-bug1112501.html positioning-transforms-bug1112501-ref.html
 fuzzy-if(browserIsRemote&&winWidget,140,276) == fieldset-columns-001.html fieldset-columns-001-ref.html
 == dynamic-change-with-overflow-1.html dynamic-change-with-overflow-1-ref.html
 == dynamic-text-indent-1.html dynamic-text-indent-1-ref.html
 == dynamic-text-indent-2.html dynamic-text-indent-2-ref.html
--- a/layout/reftests/forms/fieldset/reftest.list
+++ b/layout/reftests/forms/fieldset/reftest.list
@@ -7,17 +7,17 @@ fails-if(stylo) == fieldset-scroll-1.htm
 == fieldset-overflow-auto-1.html fieldset-overflow-auto-1-ref.html
 fuzzy-if(winWidget&&!layersGPUAccelerated,140,276) == positioned-container-1.html positioned-container-1-ref.html
 == relpos-legend-1.html relpos-legend-1-ref.html
 == relpos-legend-2.html relpos-legend-2-ref.html
 == relpos-legend-3.html relpos-legend-3-ref.html
 == relpos-legend-4.html relpos-legend-4-ref.html
 == sticky-legend-1.html sticky-legend-1-ref.html
 fuzzy-if(skiaContent,1,40768) == abs-pos-child-sizing.html abs-pos-child-sizing-ref.html
-== overflow-hidden.html overflow-hidden-ref.html
+fails-if(stylo) == overflow-hidden.html overflow-hidden-ref.html
 == legend-rtl.html legend-rtl-ref.html
 fails-if(stylo) == fieldset-grid-001.html fieldset-grid-001-ref.html
 fails-if(stylo) == fieldset-flexbox-001.html fieldset-flexbox-001-ref.html
 == fieldset-min-width-1a.html fieldset-min-width-1-ref.html
 == fieldset-min-width-1b.html fieldset-min-width-1-ref.html
 == fieldset-min-width-2a.html fieldset-min-width-2-ref.html
 == fieldset-min-width-2b.html fieldset-min-width-2-ref.html
 == legend-overlapping-right-border-1.html legend-overlapping-right-border-1-ref.html
--- a/layout/reftests/mathml/reftest.list
+++ b/layout/reftests/mathml/reftest.list
@@ -1,15 +1,15 @@
 == dir-1.html dir-1-ref.html
 == dir-2.html dir-2-ref.html
 random-if(gtkWidget) == dir-3.html dir-3-ref.html # bug 1309426
 == dir-4.html dir-4-ref.html
 == dir-5.html dir-5-ref.html
-== dir-6.html dir-6-ref.html
-== dir-6a.html dir-6a-ref.html
+fails-if(stylo) == dir-6.html dir-6-ref.html
+fails-if(stylo) == dir-6a.html dir-6a-ref.html
 == dir-7.html dir-7-ref.html
 fails-if(!stylo) == dir-8.html dir-8-ref.html
 fails-if(!stylo) == dir-9.html dir-9-ref.html # Bug 787215
 == dir-10.html dir-10-ref.html
 == dir-11.html dir-11-ref.html
 == css-spacing-1.html css-spacing-1-ref.html
 pref(mathml.disabled,true) fails-if(stylo) == disabled-scriptlevel-1.html disabled-scriptlevel-1-ref.html
 pref(mathml.disabled,true) fails-if(stylo) == disabled-scriptlevel-1.xhtml disabled-scriptlevel-1-ref.xhtml
@@ -36,17 +36,17 @@ random-if(smallScreen&&Android) fuzzy(25
 == mfenced-5a.xhtml mfenced-5-ref.xhtml
 == mfenced-5b.xhtml mfenced-5-ref.xhtml
 == mfenced-5c.xhtml mfenced-5-ref.xhtml
 == mfenced-5d.xhtml mfenced-5-ref.xhtml
 == mfenced-6.html mfenced-6-ref.html
 == mfenced-7.html mfenced-7-ref.html
 != mfenced-8.html mfenced-8-ref.html
 == mfenced-9.html mfenced-9-ref.html
-== mfenced-10.html mfenced-10-ref.html
+fails-if(stylo) == mfenced-10.html mfenced-10-ref.html
 fails-if(gtkWidget&&!stylo) == mfenced-11.html mfenced-11-ref.html # bug 670592, bug 1328771
 fails-if(gtkWidget&&!stylo) == mfenced-12.html mfenced-12-ref.html # bug 670592, bug 1328771
 == mi-mathvariant-1.xhtml mi-mathvariant-1-ref.xhtml
 == mi-mathvariant-2.xhtml mi-mathvariant-2-ref.xhtml
 != mi-mathvariant-3.html mi-mathvariant-3-ref.html
 != non-spacing-accent-1.xhtml non-spacing-accent-1-ref.xhtml
 == overbar-width-1.xhtml overbar-width-1-ref.xhtml
 == quotes-1.xhtml quotes-1-ref.xhtml
@@ -82,24 +82,24 @@ fails-if(gtkWidget&&!stylo) == mfenced-1
 == stretchy-mover-1a.html stretchy-mover-1-ref.html
 == stretchy-mover-1b.html stretchy-mover-1-ref.html
 fails-if(!stylo) == stretchy-mover-2a.html stretchy-mover-2-ref.html
 != stretchy-mover-2b.html stretchy-mover-2-ref.html
 == stretchy-mover-3.html stretchy-mover-3-ref.html
 == stretchy-largeop-1.html stretchy-largeop-1-ref.html
 == stretchy-largeop-2.html stretchy-largeop-2-ref.html
 == stretchy-largeop-3.html stretchy-largeop-3-ref.html
-== table-width-1.xhtml table-width-1-ref.xhtml
+fails-if(stylo) == table-width-1.xhtml table-width-1-ref.xhtml
 == table-width-2.html table-width-2-ref.html
 == table-width-3.html table-width-3-ref.html
 == table-width-4.html table-width-4-ref.html
 == underbar-width-1.xhtml underbar-width-1-ref.xhtml
 == mathml-type-supported.xhtml mathml-type-supported-ref.xml
-== mtable-align-negative-rownumber.html mtable-align-negative-rownumber-ref.html
-== mtable-align-negative-rownumber-2.html mtable-align-negative-rownumber-2-ref.html
+fails-if(stylo) == mtable-align-negative-rownumber.html mtable-align-negative-rownumber-ref.html
+fails-if(stylo) == mtable-align-negative-rownumber-2.html mtable-align-negative-rownumber-2-ref.html
 != embellished-op-1-1.html embellished-op-1-1-ref.html
 != embellished-op-1-2.html embellished-op-1-2-ref.html
 != embellished-op-1-3.html embellished-op-1-3-ref.html
 != embellished-op-1-4.html embellished-op-1-4-ref.html
 != embellished-op-1-5.html embellished-op-1-5-ref.html
 != embellished-op-2-1.html embellished-op-2-1-ref.html
 != embellished-op-2-2.html embellished-op-2-2-ref.html
 != embellished-op-2-3.html embellished-op-2-3-ref.html
@@ -122,17 +122,17 @@ fails-if(gtkWidget&&!stylo) random-if(wi
 != mathcolor-2.xml mathcolor-2-ref.xml
 != mathcolor-3.xml mathcolor-3-ref.xml
 == mathcolor-4.xml mathcolor-4-ref.xml
 != mathbackground-1.xml mathbackground-1-ref.xml
 != mathbackground-2.xml mathbackground-2-ref.xml
 != mathbackground-3.xml mathbackground-3-ref.xml
 == mathbackground-4.xml mathbackground-4-ref.xml
 == mstyle-1.xhtml mstyle-1-ref.xhtml
-== mstyle-2.xhtml mstyle-2-ref.xhtml
+fails-if(stylo) == mstyle-2.xhtml mstyle-2-ref.xhtml
 == mstyle-3.xhtml mstyle-3-ref.xhtml
 == mstyle-4.xhtml mstyle-4-ref.xhtml
 == mstyle-5.xhtml mstyle-5-ref.xhtml # Bug 787215
 == scale-stretchy-1.xhtml scale-stretchy-1-ref.xhtml
 != scale-stretchy-2.xhtml scale-stretchy-2-ref.xhtml
 fails-if(skiaContent&&OSX>=1010) == scale-stretchy-3.xhtml scale-stretchy-3-ref.xhtml
 != scale-stretchy-4.xhtml scale-stretchy-4-ref.xhtml
 != scale-stretchy-5.xhtml scale-stretchy-5-ref.xhtml
@@ -158,36 +158,36 @@ random-if(gtkWidget) == mpadded-9.html m
 == mfrac-linethickness-1.xhtml mfrac-linethickness-1-ref.xhtml
 == mfrac-linethickness-2.xhtml mfrac-linethickness-2-ref.xhtml
 == mfrac-linethickness-3.xhtml mfrac-linethickness-3-ref.xhtml
 == mathml-negativespace.html mathml-negativespace-ref.html
 == negative-mspace-1.html negative-mspace-1-ref.html
 != link-1.xhtml link-ref.xhtml
 == munderover-empty-scripts.html munderover-empty-scripts-ref.html
 == positive-namedspace.html positive-namedspace-ref.html
-== mtable-align-whitespace.html mtable-align-whitespace-ref.html
+fails-if(stylo) == mtable-align-whitespace.html mtable-align-whitespace-ref.html
 == mtable-width.html mtable-width-ref.html
-== mtable-rowlines-single-mtable-dynamic.html mtable-rowlines-single-ref.html
-== mtable-rowlines-multi-mtable-dynamic.html mtable-rowlines-multi-ref.html
-== mtable-rowalign-single-mtr.html mtable-rowalign-single-ref.html
-== mtable-rowalign-single-mtr-dynamic.html mtable-rowalign-single-ref.html
-== mtable-rowalign-single-mtable.html mtable-rowalign-single-ref.html
-== mtable-rowalign-single-mtable-dynamic.html mtable-rowalign-single-ref.html
-== mtable-rowalign-multi-mtable.html mtable-rowalign-multi-ref.html
-== mtable-rowalign-multi-mtable-dynamic.html mtable-rowalign-multi-ref.html
-== mtable-columnlines-single-mtable-dynamic.html mtable-columnlines-single-ref.html
-== mtable-columnlines-multi-mtable-dynamic.html mtable-columnlines-multi-ref.html
-== mtable-columnalign-single-mtr.html mtable-columnalign-single-ref.html
-== mtable-columnalign-single-mtr-dynamic.html mtable-columnalign-single-ref.html
-== mtable-columnalign-single-mtable.html mtable-columnalign-single-ref.html
-== mtable-columnalign-single-mtable-dynamic.html mtable-columnalign-single-ref.html
-== mtable-columnalign-multi-mtr.html mtable-columnalign-multi-ref.html
-== mtable-columnalign-multi-mtr-dynamic.html mtable-columnalign-multi-ref.html
-== mtable-columnalign-multi-mtable.html mtable-columnalign-multi-ref.html
-== mtable-columnalign-multi-mtable-dynamic.html mtable-columnalign-multi-ref.html
+fails-if(stylo) == mtable-rowlines-single-mtable-dynamic.html mtable-rowlines-single-ref.html
+fails-if(stylo) == mtable-rowlines-multi-mtable-dynamic.html mtable-rowlines-multi-ref.html
+fails-if(stylo) == mtable-rowalign-single-mtr.html mtable-rowalign-single-ref.html
+fails-if(stylo) == mtable-rowalign-single-mtr-dynamic.html mtable-rowalign-single-ref.html
+fails-if(stylo) == mtable-rowalign-single-mtable.html mtable-rowalign-single-ref.html
+fails-if(stylo) == mtable-rowalign-single-mtable-dynamic.html mtable-rowalign-single-ref.html
+fails-if(stylo) == mtable-rowalign-multi-mtable.html mtable-rowalign-multi-ref.html
+fails-if(stylo) == mtable-rowalign-multi-mtable-dynamic.html mtable-rowalign-multi-ref.html
+fails-if(stylo) == mtable-columnlines-single-mtable-dynamic.html mtable-columnlines-single-ref.html
+fails-if(stylo) == mtable-columnlines-multi-mtable-dynamic.html mtable-columnlines-multi-ref.html
+fails-if(stylo) == mtable-columnalign-single-mtr.html mtable-columnalign-single-ref.html
+fails-if(stylo) == mtable-columnalign-single-mtr-dynamic.html mtable-columnalign-single-ref.html
+fails-if(stylo) == mtable-columnalign-single-mtable.html mtable-columnalign-single-ref.html
+fails-if(stylo) == mtable-columnalign-single-mtable-dynamic.html mtable-columnalign-single-ref.html
+fails-if(stylo) == mtable-columnalign-multi-mtr.html mtable-columnalign-multi-ref.html
+fails-if(stylo) == mtable-columnalign-multi-mtr-dynamic.html mtable-columnalign-multi-ref.html
+fails-if(stylo) == mtable-columnalign-multi-mtable.html mtable-columnalign-multi-ref.html
+fails-if(stylo) == mtable-columnalign-multi-mtable-dynamic.html mtable-columnalign-multi-ref.html
 == maction-selection.html maction-selection-ref.html
 == maction-dynamic-embellished-op.html maction-dynamic-embellished-op-ref.html
 == maction-dynamic-1.html maction-dynamic-1-ref.html # bug 773482
 == maction-dynamic-2.html maction-dynamic-2-ref.html
 == mo-lspace-rspace.html mo-lspace-rspace-ref.html
 == mo-lspace-rspace-2.html mo-lspace-rspace-2-ref.html
 == mo-lspace-rspace-3.html mo-lspace-rspace-3-ref.html
 == mo-lspace-rspace-4.html mo-lspace-rspace-4-ref.html
@@ -301,38 +301,38 @@ fails-if(stylo) == ssty-2.html ssty-2-re
 fails-if(stylo) == ssty-3.html ssty-3-ref.html
 fails-if(stylo) == ssty-4.html ssty-4-ref.html
 fails-if(stylo) == mathscript-1.html mathscript-1-ref.html
 fails-if(stylo) == mathscript-2.html mathscript-2-ref.html
 == mo-accent-dynamic.html mo-accent-dynamic-ref.html
 == mo-movablelimits-dynamic.html mo-movablelimits-dynamic-ref.html
 == munderover-accent-dynamic.html munderover-accent-dynamic-ref.html
 == munderover-accentunder-dynamic.html munderover-accentunder-dynamic-ref.html
-== columnlines-1a.html columnlines-1-ref.html
-!= columnlines-1b.html columnlines-1-ref.html
-!= columnlines-1c.html columnlines-1-ref.html
+fails-if(stylo) == columnlines-1a.html columnlines-1-ref.html
+fails-if(stylo) != columnlines-1b.html columnlines-1-ref.html
+fails-if(stylo) != columnlines-1c.html columnlines-1-ref.html
 == columnlines-2a.html columnlines-2-ref.html
 == columnlines-2b.html columnlines-2-ref.html
 != columnlines-3-1.html columnlines-3-1-ref.html
 == columnlines-3-2.html columnlines-3-2-ref.html
-== rowlines-1a.html rowlines-1-ref.html
-!= rowlines-1b.html rowlines-1-ref.html
-!= rowlines-1c.html rowlines-1-ref.html
-== rowlines-2a.html rowlines-2-ref.html
-== rowlines-2b.html rowlines-2-ref.html
+fails-if(stylo) == rowlines-1a.html rowlines-1-ref.html
+fails-if(stylo) != rowlines-1b.html rowlines-1-ref.html
+fails-if(stylo) != rowlines-1c.html rowlines-1-ref.html
+fails-if(stylo) == rowlines-2a.html rowlines-2-ref.html
+fails-if(stylo) == rowlines-2b.html rowlines-2-ref.html
 != rowlines-3-1.html rowlines-3-1-ref.html
 random-if(gtkWidget) == rowlines-3-2.html rowlines-3-2-ref.html # bug 1309426
-== tablespacing-1.html tablespacing-1-ref.html
+fails-if(stylo) == tablespacing-1.html tablespacing-1-ref.html
 == tablespacing-2.html tablespacing-2-ref.html
 == tablespacing-3.html tablespacing-3-ref.html
 == tablespacing-4.html tablespacing-4-ref.html
-== tablespacing-5.html tablespacing-5-ref.html
-== tablespacing-5a.html tablespacing-5a-ref.html
-== tablespacing-6.html tablespacing-6-ref.html
-== tablespacing-7.html tablespacing-7-ref.html
+fails-if(stylo) == tablespacing-5.html tablespacing-5-ref.html
+fails-if(stylo) == tablespacing-5a.html tablespacing-5a-ref.html
+fails-if(stylo) == tablespacing-6.html tablespacing-6-ref.html
+fails-if(stylo) == tablespacing-7.html tablespacing-7-ref.html
 != tablespacing-8a.html tablespacing-8-ref.html
 != tablespacing-8b.html tablespacing-8-ref.html
 != op-dict-1.html op-dict-1-ref.html
 == op-dict-2.html op-dict-2-ref.html
 != op-dict-3.html op-dict-3-ref.html
 == op-dict-4.html op-dict-4-ref.html
 != op-dict-5.html op-dict-5-ref.html
 == op-dict-6.html op-dict-6-ref.html
--- a/layout/reftests/svg/svg-integration/clip-path/reftest.list
+++ b/layout/reftests/svg/svg-integration/clip-path/reftest.list
@@ -11,17 +11,17 @@ default-preferences pref(layout.css.clip
 == clip-path-polygon-005.html clip-path-rectangle-border-ref.html
 == clip-path-polygon-006.html clip-path-square-001-ref.html
 == clip-path-polygon-007.html clip-path-stripes-001-ref.html
 == clip-path-polygon-008.html clip-path-stripes-002-ref.html
 == clip-path-polygon-009.html clip-path-square-002-ref.html
 == clip-path-polygon-010.html clip-path-stripes-001-ref.html
 == clip-path-polygon-011.html clip-path-stripes-001-ref.html
 == clip-path-polygon-012.html clip-path-stripes-001-ref.html
-== clip-path-polygon-013.html clip-path-stripes-003-ref.html
+fails-if(stylo) == clip-path-polygon-013.html clip-path-stripes-003-ref.html
 
 == clip-path-circle-001.html clip-path-circle-001-ref.html
 == clip-path-circle-002.html clip-path-circle-001-ref.html
 == clip-path-circle-003.html clip-path-circle-001-ref.html
 == clip-path-circle-004.html clip-path-circle-001-ref.html
 == clip-path-circle-005.html clip-path-circle-002-ref.html
 == clip-path-circle-006.html clip-path-circle-001-ref.html
 == clip-path-circle-007.html clip-path-circle-002-ref.html
@@ -51,9 +51,9 @@ default-preferences pref(layout.css.clip
 
 == clip-path-inset-001a.html clip-path-inset-001-ref.html
 == clip-path-inset-001b.html clip-path-inset-001-ref.html
 == clip-path-inset-001c.html clip-path-inset-001-ref.html
 # Anti-aliasing behavior for masking and borders is different
 fuzzy(64,146) == clip-path-inset-002a.html clip-path-inset-002-ref.html
 fuzzy(64,146) == clip-path-inset-002b.html clip-path-inset-002-ref.html
 fuzzy(64,146) == clip-path-inset-002c.html clip-path-inset-002-ref.html
-fuzzy(64,340) == clip-path-inset-003.html clip-path-inset-003-ref.html
+fuzzy(64,340) == clip-path-inset-003.html clip-path-inset-003-ref.html
\ No newline at end of file
--- a/layout/reftests/text-overflow/reftest.list
+++ b/layout/reftests/text-overflow/reftest.list
@@ -1,38 +1,38 @@
 == ellipsis-font-fallback.html ellipsis-font-fallback-ref.html
 == line-clipping.html line-clipping-ref.html
 fuzzy-if(Android,16,244) HTTP(..) == marker-basic.html marker-basic-ref.html  # Bug 1128229
-HTTP(..) == marker-string.html marker-string-ref.html
+fails-if(stylo) HTTP(..) == marker-string.html marker-string-ref.html
 skip-if(Android) HTTP(..) == bidi-simple.html bidi-simple-ref.html # Fails on Android due to anti-aliasing
 skip-if(!gtkWidget) fuzzy-if(gtkWidget,2,289) HTTP(..) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
 fuzzy-if(Android,24,4000) fuzzy-if(cocoaWidget,1,40) fuzzy-if(asyncPan&&!layersGPUAccelerated,140,1836) HTTP(..) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
 fuzzy(2,453) fuzzy-if(skiaContent,9,2100) fails-if(gtkWidget) HTTP(..) == anonymous-block.html anonymous-block-ref.html # gtkWidget:bug 1309103
 HTTP(..) == false-marker-overlap.html false-marker-overlap-ref.html
 HTTP(..) == visibility-hidden.html visibility-hidden-ref.html
-fuzzy-if(asyncPan&&!layersGPUAccelerated,102,1724) fuzzy-if(gtkWidget,10,8) HTTP(..) == block-padding.html block-padding-ref.html
+fuzzy-if(asyncPan&&!layersGPUAccelerated,102,1724) fuzzy-if(gtkWidget,10,8) fails-if(stylo) HTTP(..) == block-padding.html block-padding-ref.html
 HTTP(..) == quirks-decorations.html quirks-decorations-ref.html
 HTTP(..) == quirks-line-height.html quirks-line-height-ref.html
 HTTP(..) == standards-decorations.html standards-decorations-ref.html
 HTTP(..) == standards-line-height.html standards-line-height-ref.html
 fuzzy-if(skiaContent,1,4200) HTTP(..) == selection.html selection-ref.html
 HTTP(..) == marker-shadow.html marker-shadow-ref.html
 == aligned-baseline.html aligned-baseline-ref.html
 skip-if(Android) fuzzy-if(skiaContent,1,5) == clipped-elements.html clipped-elements-ref.html
 HTTP(..) == theme-overflow.html theme-overflow-ref.html
 HTTP(..) == table-cell.html table-cell-ref.html
 fuzzy-if(gtkWidget,10,32) fails-if(stylo) HTTP(..) == two-value-syntax.html two-value-syntax-ref.html
 fails-if(stylo) HTTP(..) == single-value.html single-value-ref.html
 fuzzy-if(gtkWidget,10,2) HTTP(..) == atomic-under-marker.html atomic-under-marker-ref.html
-fuzzy(1,2616) skip-if(Android) fuzzy-if(asyncPan&&!layersGPUAccelerated,102,12352) fails-if(gtkWidget&&!stylo) HTTP(..) == xulscroll.html xulscroll-ref.html # gtkWidget:bug 1309107, bug 1328771
+fuzzy(1,2616) skip-if(Android) fuzzy-if(asyncPan&&!layersGPUAccelerated,102,12352) fails-if(gtkWidget) HTTP(..) == xulscroll.html xulscroll-ref.html # gtkWidget:bug 1309107, bug 1328771
 HTTP(..) == combobox-zoom.html combobox-zoom-ref.html
 == dynamic-change-1.html dynamic-change-1-ref.html
 == float-edges-1-ref.html float-edges-1-ref.html
 
 # The vertical-text pref setting can be removed after bug 1138384 lands
-== vertical-decorations-1.html vertical-decorations-1-ref.html
-== vertical-decorations-2.html vertical-decorations-2-ref.html
-!= vertical-decorations-1.html vertical-decorations-1-2-notref.html
-!= vertical-decorations-2.html vertical-decorations-1-2-notref.html
+fails-if(stylo) == vertical-decorations-1.html vertical-decorations-1-ref.html
+fails-if(stylo) == vertical-decorations-2.html vertical-decorations-2-ref.html
+fails-if(stylo) != vertical-decorations-1.html vertical-decorations-1-2-notref.html
+fails-if(stylo) != vertical-decorations-2.html vertical-decorations-1-2-notref.html
 == vertical-decorations-3.html vertical-decorations-3-ref.html
 == vertical-decorations-4.html vertical-decorations-4-ref.html
 != vertical-decorations-3.html vertical-decorations-3-4-notref.html
 != vertical-decorations-4.html vertical-decorations-3-4-notref.html
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -6,17 +6,17 @@ fails-if(Android) != font-size-adjust-01
 # The following test passes consistently only on Mac OS X;
 # both Windows and Linux give results that vary depending on the font size/zoom factor used,
 # because hinting affects the metrics used to compute the font size adjustment. See bug 429605.
 random-if(!cocoaWidget) == font-size-adjust-02.html font-size-adjust-02-ref.html
 # This currently fails because line spacing does not respect font-size-adjust
 # in the "obvious" way, but it is unclear what the behavior should really be;
 # see bug #366138 for some (inconclusive) discussion
 # == font-size-adjust-03.html font-size-adjust-03-ref.html
-== justification-1.html justification-1-ref.html
+fails-if(stylo) == justification-1.html justification-1-ref.html
 == justification-2a.html justification-2-ref.html
 == justification-2b.html justification-2-ref.html
 == justification-2c.html justification-2-ref.html
 != justification-2d.html justification-2-ref.html
 == justification-cjk-extension.html justification-cjk-extension-ref.html
 == justification-space-diacritic.html justification-space-diacritic-ref.html
 skip-if(stylo) HTTP(..) load ligature-with-space-1.html
 == line-editing-1a.html line-editing-1-ref.html
@@ -29,17 +29,17 @@ HTTP(..) == lineheight-metrics-2a.html l
 HTTP(..) == lineheight-metrics-2b.html lineheight-metrics-2-ref.html
 == lineheight-percentage-1.html lineheight-percentage-1-ref.html
 == long-1.html long-ref.html
 fuzzy-if(Android,255,147) == pre-line-1.html pre-line-1-ref.html
 == pre-line-2.html pre-line-2-ref.html
 == pre-line-3.html pre-line-3-ref.html
 == pre-line-4.html pre-line-4-ref.html
 == pre-space-1.html pre-space-1-ref.html
-== pre-wrap-1.html pre-wrap-1-ref.html
+fails-if(stylo) == pre-wrap-1.html pre-wrap-1-ref.html
 == soft-hyphens-1a.html soft-hyphens-1-ref.html
 == soft-hyphens-1b.html soft-hyphens-1-ref.html
 == soft-hyphens-1c.html soft-hyphens-1-ref.html
 == soft-hyphens-break-word-1a.html soft-hyphens-break-word-1-ref.html
 == soft-hyphens-break-word-1b.html soft-hyphens-break-word-1-ref.html
 == soft-hyphens-break-word-1c.html soft-hyphens-break-word-1-ref.html
 # Tests for soft hyphens in table cells, bug 418975
 != soft-hyphen-in-table-1.html soft-hyphen-in-table-1-notref.html
@@ -117,17 +117,17 @@ HTTP(..) == variation-selector-unsupport
 skip-if(Android) == wordbreak-4a.html wordbreak-4a-ref.html
 == wordbreak-4b.html wordbreak-4b-ref.html
 == wordbreak-5.html wordbreak-5-ref.html
 fails-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == wordbreak-6.html wordbreak-6-ref.html # Bug 1258239
 HTTP(..) == wordbreak-7a.html wordbreak-7a-ref.html
 fails-if(!stylo) HTTP(..) == wordbreak-7b.html wordbreak-7b-ref.html # bug 479829
 == wordbreak-8.html wordbreak-8-ref.html
 pref(gfx.font_rendering.graphite.enabled,true) HTTP(..) == wordbreak-9.html wordbreak-9-ref.html
-== wordbreak-dynamic-1.html wordbreak-dynamic-1-ref.html
+fails-if(stylo) == wordbreak-dynamic-1.html wordbreak-dynamic-1-ref.html
 fails-if(stylo) == wordwrap-01.html wordwrap-01-ref.html
 fails-if(stylo) HTTP(..) == wordwrap-02.html wordwrap-02-ref.html
 fuzzy-if(gtkWidget,1,177) fuzzy-if(skiaContent,1,50) fails-if(stylo) HTTP(..) == wordwrap-03.html wordwrap-03-ref.html # Fuzzy on Linux because the native textbox gradient is painted in a slightly different position depending on the invalid area.
 == wordwrap-04.html wordwrap-04-ref.html
 == overflowwrap-04.html wordwrap-04-ref.html
 == wordwrap-05.html wordwrap-05-ref.html
 == overflowwrap-05.html wordwrap-05-ref.html
 == wordwrap-06.html wordwrap-06-ref.html
@@ -312,19 +312,19 @@ fails-if(stylo) == auto-hyphenation-pl-1
 == auto-hyphenation-sr-1.html auto-hyphenation-sr-1-ref.html
 == auto-hyphenation-sv-1.html auto-hyphenation-sv-1-ref.html # test swedish patterns
 != auto-hyphenation-sv-1.html auto-hyphenation-sv-1-notref.html # verify swedish != english
 == auto-hyphenation-tr-1.html auto-hyphenation-tr-1-ref.html
 == auto-hyphenation-uk-1.html auto-hyphenation-uk-1-ref.html
 
 == auto-hyphenation-transformed-1.html auto-hyphenation-transformed-1-ref.html
 
-== hyphenation-control-1.html hyphenation-control-1-ref.html
-== hyphenation-control-2.html hyphenation-control-2-ref.html
-== hyphenation-control-3.html hyphenation-control-3-ref.html
+fails-if(stylo) == hyphenation-control-1.html hyphenation-control-1-ref.html
+fails-if(stylo) == hyphenation-control-2.html hyphenation-control-2-ref.html
+fails-if(stylo) == hyphenation-control-3.html hyphenation-control-3-ref.html
 
 # osx-font-smoothing - with and without subpixel AA, only under OSX
 fails-if(!cocoaWidget&&!stylo) != osx-font-smoothing.html osx-font-smoothing-ref.html
 fails-if(!cocoaWidget&&!stylo) != osx-font-smoothing-2.html osx-font-smoothing-2-notref.html
 == osx-font-smoothing-2.html osx-font-smoothing-2-ref.html
 
 pref(layout.css.text-align-unsafe-value.enabled,true) fails-if(stylo) == text-align-unsafe.html text-align-unsafe-ref.html
 
--- a/layout/reftests/w3c-css/failures.list
+++ b/layout/reftests/w3c-css/failures.list
@@ -20,17 +20,17 @@ pref(dom.webcomponents.enabled,true) nee
 
 # Bug 1208113
 fails-if(!stylo) needs-focus selectors-4/focus-within-shadow-001.html
 
 
 #### CSS Values 3 ####################################################
 
 # Fuzzy
-fuzzy-if(OSX,40,6) css-values-3/ch-unit-001.html
+fuzzy-if(OSX,40,6) fails-if(stylo) css-values-3/ch-unit-001.html
 
 # Bug 435426
 fails-if(!stylo) css-values-3/attr-*.html
       css-values-3/attr-*-invalid-fallback.html
       css-values-3/attr-invalid-type-???.html
 
 # Bug 1256575
 fails-if(!stylo) css-values-3/calc-in-media-queries-???.html
--- a/layout/reftests/w3c-css/received/reftest.list
+++ b/layout/reftests/w3c-css/received/reftest.list
@@ -218,17 +218,17 @@ fails-if(!stylo) == css-values-3/attr-le
 fails-if(!stylo) == css-values-3/attr-px-invalid-cast.html css-values-3/reference/200-200-green.html
 == css-values-3/attr-px-invalid-fallback.html css-values-3/reference/200-200-green.html
 fails-if(!stylo) == css-values-3/attr-px-valid.html css-values-3/reference/200-200-green.html
 == css-values-3/calc-in-calc.html css-values-3/reference/all-green.html
 fails == css-values-3/calc-in-media-queries-001.html css-values-3/reference/all-green.html
 fails == css-values-3/calc-in-media-queries-002.html css-values-3/reference/all-green.html
 == css-values-3/calc-invalid-range-clamping.html css-values-3/reference/200-200-green.html
 == css-values-3/calc-parenthesis-stack.html css-values-3/reference/all-green.html
-fuzzy-if(OSX,40,6) == css-values-3/ch-unit-001.html css-values-3/reference/ch-unit-001-ref.html
+fuzzy-if(OSX,40,6) fails-if(stylo) == css-values-3/ch-unit-001.html css-values-3/reference/ch-unit-001-ref.html
 == css-values-3/initial-background-color.html css-values-3/reference/all-green.html
 == css-values-3/vh-calc-support-pct.html css-values-3/reference/all-green.html
 == css-values-3/vh-calc-support.html css-values-3/reference/all-green.html
 == css-values-3/vh-em-inherit.html css-values-3/reference/all-green.html
 == css-values-3/vh-inherit.html css-values-3/reference/all-green.html
 == css-values-3/vh-interpolate-pct.html css-values-3/reference/all-green.html
 == css-values-3/vh-interpolate-px.html css-values-3/reference/all-green.html
 == css-values-3/vh-interpolate-vh.html css-values-3/reference/all-green.html
--- a/layout/reftests/w3c-css/submitted/text3/reftest.list
+++ b/layout/reftests/w3c-css/submitted/text3/reftest.list
@@ -7,17 +7,17 @@
 
 pref(layout.css.text-justify.enabled,true) == text-justify-none-001.html text-justify-none-001-ref.html
 pref(layout.css.text-justify.enabled,true) == text-justify-inter-word-001.html text-justify-inter-word-001-ref.html
 pref(layout.css.text-justify.enabled,true) == text-justify-inter-character-001.html text-justify-inter-character-001-ref.html
 pref(layout.css.text-justify.enabled,true) == text-justify-distribute-001.html text-justify-inter-character-001-ref.html
 
 == text-word-spacing-001.html text-word-spacing-ref.html
 
-== hyphenation-control-1.html hyphenation-control-1-ref.html
+fails-if(stylo) == hyphenation-control-1.html hyphenation-control-1-ref.html
 
 == segment-break-transformation-removable-1.html segment-break-transformation-removable-ref.html
 == segment-break-transformation-removable-2.html segment-break-transformation-removable-ref.html
 == segment-break-transformation-removable-3.html segment-break-transformation-removable-ref.html
 == segment-break-transformation-removable-4.html segment-break-transformation-removable-ref.html
 == segment-break-transformation-unremovable-1.html segment-break-transformation-unremovable-ref.html
 == segment-break-transformation-unremovable-2.html segment-break-transformation-unremovable-ref.html
 == segment-break-transformation-unremovable-3.html segment-break-transformation-unremovable-ref.html
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -7,18 +7,16 @@
 
 #include <algorithm>
 #include "mozilla/dom/FontFaceBinding.h"
 #include "mozilla/dom/FontFaceSet.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/TypedArray.h"
 #include "mozilla/dom/UnionTypes.h"
 #include "mozilla/CycleCollectedJSContext.h"
-#include "mozilla/ServoStyleSet.h"
-#include "mozilla/ServoUtils.h"
 #include "nsCSSFontFaceRule.h"
 #include "nsCSSParser.h"
 #include "nsIDocument.h"
 #include "nsStyleUtil.h"
 
 namespace mozilla {
 namespace dom {
 
@@ -109,20 +107,16 @@ FontFace::FontFace(nsISupports* aParent,
   , mSourceBufferLength(0)
   , mFontFaceSet(aFontFaceSet)
   , mInFontFaceSet(false)
 {
 }
 
 FontFace::~FontFace()
 {
-  // Assert that we don't drop any FontFace objects during a Servo traversal,
-  // since PostTraversalTask objects can hold raw pointers to FontFaces.
-  MOZ_ASSERT(!ServoStyleSet::IsInServoTraversal());
-
   SetUserFontEntry(nullptr);
 
   if (mSourceBuffer) {
     free(mSourceBuffer);
   }
 }
 
 JSObject*
@@ -132,17 +126,16 @@ FontFace::WrapObject(JSContext* aCx, JS:
 }
 
 static FontFaceLoadStatus
 LoadStateToStatus(gfxUserFontEntry::UserFontLoadState aLoadState)
 {
   switch (aLoadState) {
     case gfxUserFontEntry::UserFontLoadState::STATUS_NOT_LOADED:
       return FontFaceLoadStatus::Unloaded;
-    case gfxUserFontEntry::UserFontLoadState::STATUS_LOAD_PENDING:
     case gfxUserFontEntry::UserFontLoadState::STATUS_LOADING:
       return FontFaceLoadStatus::Loading;
     case gfxUserFontEntry::UserFontLoadState::STATUS_LOADED:
       return FontFaceLoadStatus::Loaded;
     case gfxUserFontEntry::UserFontLoadState::STATUS_FAILED:
       return FontFaceLoadStatus::Error;
   }
   NS_NOTREACHED("invalid aLoadState value");
@@ -359,18 +352,16 @@ FontFaceLoadStatus
 FontFace::Status()
 {
   return mStatus;
 }
 
 Promise*
 FontFace::Load(ErrorResult& aRv)
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   mFontFaceSet->FlushUserFontSet();
 
   EnsurePromise();
 
   if (!mLoaded) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
@@ -418,35 +409,31 @@ FontFace::DoLoad()
     return;
   }
   mUserFontEntry->Load();
 }
 
 Promise*
 FontFace::GetLoaded(ErrorResult& aRv)
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   mFontFaceSet->FlushUserFontSet();
 
   EnsurePromise();
 
   if (!mLoaded) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   return mLoaded;
 }
 
 void
 FontFace::SetStatus(FontFaceLoadStatus aStatus)
 {
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
   if (mStatus == aStatus) {
     return;
   }
 
   if (aStatus < mStatus) {
     // We're being asked to go backwards in status!  Normally, this shouldn't
     // happen.  But it can if the FontFace had a user font entry that had
     // loaded, but then was given a new one by FontFaceSet::InsertRuleFontFace
@@ -462,55 +449,27 @@ FontFace::SetStatus(FontFaceLoadStatus a
   }
 
   for (FontFaceSet* otherSet : mOtherFontFaceSets) {
     otherSet->OnFontFaceStatusChanged(this);
   }
 
   if (mStatus == FontFaceLoadStatus::Loaded) {
     if (mLoaded) {
-      DoResolve();
+      mLoaded->MaybeResolve(this);
     }
   } else if (mStatus == FontFaceLoadStatus::Error) {
     if (mSourceType == eSourceType_Buffer) {
       Reject(NS_ERROR_DOM_SYNTAX_ERR);
     } else {
       Reject(NS_ERROR_DOM_NETWORK_ERR);
     }
   }
 }
 
-void
-FontFace::DoResolve()
-{
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
-  if (ServoStyleSet* ss = ServoStyleSet::Current()) {
-    // See comments in Gecko_GetFontMetrics.
-    ss->AppendTask(PostTraversalTask::ResolveFontFaceLoadedPromise(this));
-    return;
-  }
-
-  mLoaded->MaybeResolve(this);
-}
-
-void
-FontFace::DoReject(nsresult aResult)
-{
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
-  if (ServoStyleSet* ss = ServoStyleSet::Current()) {
-    // See comments in Gecko_GetFontMetrics.
-    ss->AppendTask(PostTraversalTask::RejectFontFaceLoadedPromise(this, aResult));
-    return;
-  }
-
-  mLoaded->MaybeReject(aResult);
-}
-
 bool
 FontFace::ParseDescriptor(nsCSSFontDesc aDescID,
                           const nsAString& aString,
                           nsCSSValue& aResult)
 {
   nsCSSParser parser;
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(mParent);
@@ -768,30 +727,26 @@ FontFace::RemoveFontFaceSet(FontFaceSet*
   } else {
     mOtherFontFaceSets.RemoveElement(aFontFaceSet);
   }
 }
 
 void
 FontFace::Reject(nsresult aResult)
 {
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
   if (mLoaded) {
-    DoReject(aResult);
+    mLoaded->MaybeReject(aResult);
   } else if (mLoadedRejection == NS_OK) {
     mLoadedRejection = aResult;
   }
 }
 
 void
 FontFace::EnsurePromise()
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   if (mLoaded) {
     return;
   }
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(mParent);
 
   // If the pref is not set, don't create the Promise (which the page wouldn't
   // be able to get to anyway) as it causes the window.FontFace constructor
--- a/layout/style/FontFace.h
+++ b/layout/style/FontFace.h
@@ -13,33 +13,31 @@
 #include "nsCSSValue.h"
 #include "nsWrapperCache.h"
 
 class gfxFontFaceBufferSource;
 class nsCSSFontFaceRule;
 
 namespace mozilla {
 struct CSSFontFaceDescriptors;
-class PostTraversalTask;
 namespace dom {
 class FontFaceBufferSource;
 struct FontFaceDescriptors;
 class FontFaceSet;
 class Promise;
 class StringOrArrayBufferOrArrayBufferView;
 } // namespace dom
 } // namespace mozilla
 
 namespace mozilla {
 namespace dom {
 
 class FontFace final : public nsISupports,
                        public nsWrapperCache
 {
-  friend class mozilla::PostTraversalTask;
   friend class mozilla::dom::FontFaceBufferSource;
   friend class Entry;
 
 public:
   class Entry final : public gfxUserFontEntry {
     friend class FontFace;
 
   public:
@@ -204,19 +202,16 @@ private:
   // Acts like mLoaded->MaybeReject(aResult), except it doesn't create mLoaded
   // if it doesn't already exist.
   void Reject(nsresult aResult);
 
   // Creates mLoaded if it doesn't already exist. It may immediately resolve or
   // reject mLoaded based on mStatus and mLoadedRejection.
   void EnsurePromise();
 
-  void DoResolve();
-  void DoReject(nsresult aResult);
-
   nsCOMPtr<nsISupports> mParent;
 
   // A Promise that is fulfilled once the font represented by this FontFace is
   // loaded, and is rejected if the load fails. This promise is created lazily
   // when JS asks for it.
   RefPtr<mozilla::dom::Promise> mLoaded;
 
   // Saves the rejection code for mLoaded if mLoaded hasn't been created yet.
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -12,18 +12,16 @@
 #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/ServoStyleSet.h"
-#include "mozilla/ServoUtils.h"
 #include "mozilla/SizePrintfMacros.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/Telemetry.h"
 #include "nsAutoPtr.h"
 #include "nsContentPolicyUtils.h"
 #include "nsCSSParser.h"
 #include "nsDeviceContext.h"
 #include "nsFontFaceLoader.h"
@@ -125,20 +123,16 @@ FontFaceSet::FontFaceSet(nsPIDOMWindowIn
 
   mDocument->CSSLoader()->AddObserver(this);
 
   mUserFontSet = new UserFontSet(this);
 }
 
 FontFaceSet::~FontFaceSet()
 {
-  // Assert that we don't drop any FontFaceSet objects during a Servo traversal,
-  // since PostTraversalTask objects can hold raw pointers to FontFaceSets.
-  MOZ_ASSERT(!ServoStyleSet::IsInServoTraversal());
-
   Disconnect();
   for (auto it = mLoaders.Iter(); !it.Done(); it.Next()) {
     it.Get()->GetKey()->Cancel();
   }
 }
 
 JSObject*
 FontFaceSet::WrapObject(JSContext* aContext, JS::Handle<JSObject*> aGivenProto)
@@ -381,18 +375,16 @@ FontFaceSet::Check(const nsAString& aFon
   }
 
   return true;
 }
 
 Promise*
 FontFaceSet::GetReady(ErrorResult& aRv)
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   if (!mReady) {
     nsCOMPtr<nsIGlobalObject> global = GetParentObject();
     mReady = Promise::Create(global, aRv);
     if (!mReady) {
       aRv.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
     if (mResolveLazilyCreatedReadyPromise) {
@@ -1465,18 +1457,16 @@ FontFaceSet::GetPrivateBrowsing()
 {
   nsCOMPtr<nsILoadContext> loadContext = mDocument->GetLoadContext();
   return loadContext && loadContext->UsePrivateBrowsing();
 }
 
 void
 FontFaceSet::OnFontFaceStatusChanged(FontFace* aFontFace)
 {
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
   MOZ_ASSERT(HasAvailableFontFace(aFontFace));
 
   mHasLoadingFontFacesIsDirty = true;
 
   if (aFontFace->Status() == FontFaceLoadStatus::Loading) {
     CheckLoadingStarted();
   } else {
     MOZ_ASSERT(aFontFace->Status() == FontFaceLoadStatus::Loaded ||
@@ -1485,93 +1475,51 @@ FontFaceSet::OnFontFaceStatusChanged(Fon
     // will be called immediately afterwards to request a reflow of the
     // relevant elements in the document.  We want to wait until the reflow
     // request has been done before the FontFaceSet is marked as Loaded so
     // that we don't briefly set the FontFaceSet to Loaded and then Loading
     // again once the reflow is pending.  So we go around the event loop
     // and call CheckLoadingFinished() after the reflow has been queued.
     if (!mDelayedLoadCheck) {
       mDelayedLoadCheck = true;
-      DispatchCheckLoadingFinishedAfterDelay();
+      nsCOMPtr<nsIRunnable> checkTask =
+        NewRunnableMethod(this, &FontFaceSet::CheckLoadingFinishedAfterDelay);
+      mDocument->Dispatch("FontFaceSet::CheckLoadingFinishedAfterDelay",
+                          TaskCategory::Other, checkTask.forget());
     }
   }
 }
 
 void
-FontFaceSet::DispatchCheckLoadingFinishedAfterDelay()
-{
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
-  if (ServoStyleSet* set = ServoStyleSet::Current()) {
-    // See comments in Gecko_GetFontMetrics.
-    //
-    // We can't just dispatch the runnable below if we're not on the main
-    // thread, since it needs to take a strong reference to the FontFaceSet,
-    // and being a DOM object, FontFaceSet doesn't support thread-safe
-    // refcounting.
-    set->AppendTask(PostTraversalTask::DispatchFontFaceSetCheckLoadingFinishedAfterDelay(this));
-    return;
-  }
-
-  nsCOMPtr<nsIRunnable> checkTask =
-    NewRunnableMethod(this, &FontFaceSet::CheckLoadingFinishedAfterDelay);
-  mDocument->Dispatch("FontFaceSet::CheckLoadingFinishedAfterDelay",
-                      TaskCategory::Other, checkTask.forget());
-}
-
-void
 FontFaceSet::DidRefresh()
 {
   CheckLoadingFinished();
 }
 
 void
 FontFaceSet::CheckLoadingFinishedAfterDelay()
 {
   mDelayedLoadCheck = false;
   CheckLoadingFinished();
 }
 
 void
 FontFaceSet::CheckLoadingStarted()
 {
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
   if (!HasLoadingFontFaces()) {
     return;
   }
 
   if (mStatus == FontFaceSetLoadStatus::Loading) {
     // We have already dispatched a loading event and replaced mReady
     // with a fresh, unresolved promise.
     return;
   }
 
   mStatus = FontFaceSetLoadStatus::Loading;
-  DispatchLoadingEventAndReplaceReadyPromise();
-}
-
-void
-FontFaceSet::DispatchLoadingEventAndReplaceReadyPromise()
-{
-  AssertIsMainThreadOrServoFontMetricsLocked();
-
-  if (ServoStyleSet* set = ServoStyleSet::Current()) {
-    // See comments in Gecko_GetFontMetrics.
-    //
-    // We can't just dispatch the runnable below if we're not on the main
-    // thread, since it needs to take a strong reference to the FontFaceSet,
-    // and being a DOM object, FontFaceSet doesn't support thread-safe
-    // refcounting.  (Also, the Promise object creation must be done on
-    // the main thread.)
-    set->AppendTask(
-      PostTraversalTask::DispatchLoadingEventAndReplaceReadyPromise(this));
-    return;
-  }
-
   (new AsyncEventDispatcher(this, NS_LITERAL_STRING("loading"),
                             false))->PostDOMEvent();
 
   if (PrefEnabled()) {
     if (mReady) {
       if (GetParentObject()) {
         ErrorResult rv;
         mReady = Promise::Create(GetParentObject(), rv);
@@ -1641,18 +1589,16 @@ FontFaceSet::MightHavePendingFontLoads()
   }
 
   return false;
 }
 
 void
 FontFaceSet::CheckLoadingFinished()
 {
-  MOZ_ASSERT(NS_IsMainThread());
-
   if (mDelayedLoadCheck) {
     // Wait until the runnable posted in OnFontFaceStatusChanged calls us.
     return;
   }
 
   if (mStatus == FontFaceSetLoadStatus::Loaded) {
     // We've already resolved mReady and dispatched the loadingdone/loadingerror
     // events.
--- a/layout/style/FontFaceSet.h
+++ b/layout/style/FontFaceSet.h
@@ -15,34 +15,32 @@
 
 struct gfxFontFaceSrc;
 class gfxUserFontEntry;
 class nsFontFaceLoader;
 class nsIPrincipal;
 class nsPIDOMWindowInner;
 
 namespace mozilla {
-class PostTraversalTask;
 namespace css {
 class FontFamilyListRefCnt;
 } // namespace css
 namespace dom {
 class FontFace;
 class Promise;
 } // namespace dom
 } // namespace mozilla
 
 namespace mozilla {
 namespace dom {
 
 class FontFaceSet final : public DOMEventTargetHelper
                         , public nsIDOMEventListener
                         , public nsICSSLoaderObserver
 {
-  friend class mozilla::PostTraversalTask;
   friend class UserFontSet;
 
 public:
   /**
    * A gfxUserFontSet that integrates with the layout and style systems to
    * manage @font-face rules and handle network requests for font loading.
    *
    * We would combine this class and FontFaceSet into the one class if it were
@@ -300,19 +298,16 @@ private:
               int32_t& aStretch,
               uint8_t& aStyle,
               ErrorResult& aRv);
   void FindMatchingFontFaces(const nsAString& aFont,
                              const nsAString& aText,
                              nsTArray<FontFace*>& aFontFaces,
                              mozilla::ErrorResult& aRv);
 
-  void DispatchLoadingEventAndReplaceReadyPromise();
-  void DispatchCheckLoadingFinishedAfterDelay();
-
   TimeStamp GetNavigationStartTimeStamp();
 
   RefPtr<UserFontSet> mUserFontSet;
 
   // The document this is a FontFaceSet for.
   nsCOMPtr<nsIDocument> mDocument;
 
   // A Promise that is fulfilled once all of the FontFace objects
deleted file mode 100644
--- a/layout/style/PostTraversalTask.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- 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 "PostTraversalTask.h"
-
-#include "mozilla/dom/FontFace.h"
-#include "mozilla/dom/FontFaceSet.h"
-#include "gfxUserFontSet.h"
-
-namespace mozilla {
-
-using namespace dom;
-
-void
-PostTraversalTask::Run()
-{
-  switch (mType) {
-    case Type::ResolveFontFaceLoadedPromise:
-      static_cast<FontFace*>(mTarget)->DoResolve();
-      break;
-
-    case Type::RejectFontFaceLoadedPromise:
-      static_cast<FontFace*>(mTarget)->DoReject(mResult);
-      break;
-
-    case Type::DispatchLoadingEventAndReplaceReadyPromise:
-      static_cast<FontFaceSet*>(mTarget)->
-        DispatchLoadingEventAndReplaceReadyPromise();
-      break;
-
-    case Type::DispatchFontFaceSetCheckLoadingFinishedAfterDelay:
-      static_cast<FontFaceSet*>(mTarget)->
-        DispatchCheckLoadingFinishedAfterDelay();
-      break;
-
-    case Type::LoadFontEntry:
-      static_cast<gfxUserFontEntry*>(mTarget)->ContinueLoad();
-      break;
-  }
-}
-
-} // namespace mozilla
deleted file mode 100644
--- a/layout/style/PostTraversalTask.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- 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/. */
-
-#ifndef mozilla_PostTraversalTask_h
-#define mozilla_PostTraversalTask_h
-
-/* a task to be performed immediately after a Servo traversal */
-
-namespace mozilla {
-namespace dom {
-class FontFace;
-class FontFaceSet;
-} // namespace dom
-} // namespace mozilla
-class gfxUserFontEntry;
-
-namespace mozilla {
-
-/**
- * A PostTraversalTask is a task to be performed immediately after a Servo
- * traversal.  There are just a few tasks we need to perform, so we use this
- * class rather than Runnables, to avoid virtual calls and some allocations.
- *
- * A PostTraversalTask is only safe to run immediately after the Servo
- * traversal, since it can hold raw pointers to DOM objects.
- */
-class PostTraversalTask
-{
-public:
-  static PostTraversalTask ResolveFontFaceLoadedPromise(dom::FontFace* aFontFace)
-  {
-    auto task = PostTraversalTask(Type::ResolveFontFaceLoadedPromise);
-    task.mTarget = aFontFace;
-    return task;
-  }
-
-  static PostTraversalTask RejectFontFaceLoadedPromise(dom::FontFace* aFontFace,
-                                                       nsresult aResult)
-  {
-    auto task = PostTraversalTask(Type::ResolveFontFaceLoadedPromise);
-    task.mTarget = aFontFace;
-    task.mResult = aResult;
-    return task;
-  }
-
-  static PostTraversalTask DispatchLoadingEventAndReplaceReadyPromise(
-    dom::FontFaceSet* aFontFaceSet)
-  {
-    auto task =
-      PostTraversalTask(Type::DispatchLoadingEventAndReplaceReadyPromise);
-    task.mTarget = aFontFaceSet;
-    return task;
-  }
-
-  static PostTraversalTask DispatchFontFaceSetCheckLoadingFinishedAfterDelay(
-    dom::FontFaceSet* aFontFaceSet)
-  {
-    auto task =
-      PostTraversalTask(Type::DispatchFontFaceSetCheckLoadingFinishedAfterDelay);
-    task.mTarget = aFontFaceSet;
-    return task;
-  }
-
-  static PostTraversalTask LoadFontEntry(gfxUserFontEntry* aFontEntry)
-  {
-    auto task = PostTraversalTask(Type::LoadFontEntry);
-    task.mTarget = aFontEntry;
-    return task;
-  }
-
-  void Run();
-
-private:
-  // For any new raw pointer type that we need to store in a PostTraversalTask,
-  // please add an assertion that class' destructor that we are not in a Servo
-  // traversal, to protect against the possibility of having dangling pointers.
-  enum class Type
-  {
-    // mTarget (FontFace*)
-    ResolveFontFaceLoadedPromise,
-
-    // mTarget (FontFace*)
-    // mResult
-    RejectFontFaceLoadedPromise,
-
-    // mTarget (FontFaceSet*)
-    DispatchLoadingEventAndReplaceReadyPromise,
-
-    // mTarget (FontFaceSet*)
-    DispatchFontFaceSetCheckLoadingFinishedAfterDelay,
-
-    // mTarget (gfxUserFontEntry*)
-    LoadFontEntry,
-  };
-
-  PostTraversalTask(Type aType)
-    : mType(aType)
-    , mTarget(nullptr)
-    , mResult(NS_OK)
-  {
-  }
-
-  Type mType;
-  void* mTarget;
-  nsresult mResult;
-};
-
-} // namespace mozilla
-
-#endif // mozilla_PostTraversalTask_h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1816,50 +1816,30 @@ InitializeServo()
 
 void
 ShutdownServo()
 {
   delete sServoFontMetricsLock;
   Servo_Shutdown();
 }
 
-namespace mozilla {
-
-void
-AssertIsMainThreadOrServoFontMetricsLocked()
-{
-  if (!NS_IsMainThread()) {
-    MOZ_ASSERT(sServoFontMetricsLock);
-    sServoFontMetricsLock->AssertCurrentThreadOwns();
-  }
-}
-
-} // namespace mozilla
-
 GeckoFontMetrics
 Gecko_GetFontMetrics(RawGeckoPresContextBorrowed aPresContext,
                      bool aIsVertical,
                      const nsStyleFont* aFont,
                      nscoord aFontSize,
                      bool aUseUserFontSet)
 {
+  // This function is still unsafe due to frobbing DOM and network
+  // off main thread. We currently disable it in Servo, see bug 1356105
+  MOZ_ASSERT(NS_IsMainThread());
   MutexAutoLock lock(*sServoFontMetricsLock);
   GeckoFontMetrics ret;
-
-  // Getting font metrics can require some main thread only work to be
-  // done, such as work that needs to touch non-threadsafe refcounted
-  // objects (like the DOM FontFace/FontFaceSet objects), network loads, etc.
-  //
-  // To handle this work, font code checks whether we are in a Servo traversal
-  // and if so, appends PostTraversalTasks to the current ServoStyleSet
-  // to be performed immediately after the traversal is finished.  This
-  // works well for starting downloadable font loads, since we don't have
-  // those fonts available to get metrics for anyway.  Platform fonts and
-  // ArrayBuffer-backed FontFace objects are handled synchronously.
-
+  // Safe because we are locked, and this function is only
+  // ever called from Servo parallel traversal or the main thread
   nsPresContext* presContext = const_cast<nsPresContext*>(aPresContext);
   presContext->SetUsesExChUnits(true);
   RefPtr<nsFontMetrics> fm = nsRuleNode::GetMetricsFor(presContext, aIsVertical,
                                                        aFont, aFontSize,
                                                        aUseUserFontSet);
   ret.mXSize = fm->XHeight();
   gfxFloat zeroWidth = fm->GetThebesFontGroup()->GetFirstValidFont()->
                            GetMetrics(fm->Orientation()).zeroOrAveCharWidth;
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -290,17 +290,18 @@ ServoStyleSet::PrepareAndTraverseSubtree
                                          TraversalRestyleBehavior
                                            aRestyleBehavior)
 {
   // Get the Document's root element to ensure that the cache is valid before
   // calling into the (potentially-parallel) Servo traversal, where a cache hit
   // is necessary to avoid a data race when updating the cache.
   mozilla::Unused << aRoot->OwnerDoc()->GetRootElement();
 
-  AutoSetInServoTraversal guard(this);
+  MOZ_ASSERT(!sInServoTraversal);
+  sInServoTraversal = true;
 
   bool isInitial = !aRoot->HasServoData();
   bool forReconstruct =
     aRestyleBehavior == TraversalRestyleBehavior::ForReconstruct;
   bool postTraversalRequired =
     Servo_TraverseSubtree(aRoot, mRawSet.get(), aRootBehavior, aRestyleBehavior);
   MOZ_ASSERT_IF(isInitial || forReconstruct, !postTraversalRequired);
 
@@ -332,16 +333,17 @@ ServoStyleSet::PrepareAndTraverseSubtree
         MOZ_ASSERT(!postTraversalRequired);
         ServoRestyleManager::ClearRestyleStateFromSubtree(root);
       } else {
         postTraversalRequired = true;
       }
     }
   }
 
+  sInServoTraversal = false;
   return postTraversalRequired;
 }
 
 already_AddRefed<nsStyleContext>
 ServoStyleSet::ResolveStyleFor(Element* aElement,
                                nsStyleContext* aParentContext,
                                LazyComputeBehavior aMayCompute,
                                TreeMatchContext& aTreeMatchContext)
@@ -976,18 +978,18 @@ ServoStyleSet::ClearNonInheritingStyleCo
     ptr = nullptr;
   }
 }
 
 already_AddRefed<ServoComputedValues>
 ServoStyleSet::ResolveStyleLazily(Element* aElement, nsIAtom* aPseudoTag)
 {
   mPresContext->EffectCompositor()->PreTraverse(aElement, aPseudoTag);
-
-  AutoSetInServoTraversal guard(this);
+  MOZ_ASSERT(!sInServoTraversal);
+  sInServoTraversal = true;
 
   /**
    * NB: This is needed because we process animations and transitions on the
    * pseudo-elements themselves, not on the parent's EagerPseudoStyles.
    *
    * That means that that style doesn't account for animations, and we can't do
    * that easily from the traversal without doing wasted work.
    *
@@ -1016,16 +1018,18 @@ ServoStyleSet::ResolveStyleLazily(Elemen
 
   if (mPresContext->EffectCompositor()->PreTraverse(aElement, aPseudoTag)) {
     computedValues =
       Servo_ResolveStyleLazily(elementForStyleResolution,
                                pseudoTagForStyleResolution,
                                mRawSet.get()).Consume();
   }
 
+  sInServoTraversal = false;
+
   return computedValues.forget();
 }
 
 bool
 ServoStyleSet::AppendFontFaceRules(nsTArray<nsFontFaceRuleContainer>& aArray)
 {
   Servo_StyleSet_GetFontFaceRules(mRawSet.get(), &aArray);
   return true;
@@ -1101,26 +1105,9 @@ ServoStyleSet::RemoveSheetOfType(SheetTy
       uint32_t uniqueID = mEntries[aType][i].uniqueID;
       mEntries[aType].RemoveElementAt(i);
       return uniqueID;
     }
   }
   return 0;
 }
 
-void
-ServoStyleSet::RunPostTraversalTasks()
-{
-  MOZ_ASSERT(!IsInServoTraversal());
-
-  if (mPostTraversalTasks.IsEmpty()) {
-    return;
-  }
-
-  nsTArray<PostTraversalTask> tasks;
-  tasks.SwapElements(mPostTraversalTasks);
-
-  for (auto& task : tasks) {
-    task.Run();
-  }
-}
-
-ServoStyleSet* ServoStyleSet::sInServoTraversal = nullptr;
+bool ServoStyleSet::sInServoTraversal = false;
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -4,20 +4,18 @@
  * 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/. */
 
 #ifndef mozilla_ServoStyleSet_h
 #define mozilla_ServoStyleSet_h
 
 #include "mozilla/EnumeratedArray.h"
 #include "mozilla/EventStates.h"
-#include "mozilla/PostTraversalTask.h"
 #include "mozilla/ServoBindingTypes.h"
 #include "mozilla/ServoElementSnapshot.h"
-#include "mozilla/ServoUtils.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/SheetType.h"
 #include "mozilla/UniquePtr.h"
 #include "MainThreadUtils.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsChangeHint.h"
 #include "nsIAtom.h"
@@ -82,21 +80,16 @@ public:
     // maintain this static boolean. However, the danger is that those callers
     // are generally unprepared to deal with non-Servo-but-also-non-main-thread
     // callers, and are likely to take the main-thread codepath if this function
     // returns false. So we assert against other non-main-thread callers here.
     MOZ_ASSERT(sInServoTraversal || NS_IsMainThread());
     return sInServoTraversal;
   }
 
-  static ServoStyleSet* Current()
-  {
-    return sInServoTraversal;
-  }
-
   ServoStyleSet();
   ~ServoStyleSet();
 
   void Init(nsPresContext* aPresContext);
   void BeginShutdown();
   void Shutdown();
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
@@ -310,54 +303,17 @@ public:
   already_AddRefed<ServoComputedValues>
   ResolveForDeclarations(ServoComputedValuesBorrowedOrNull aParentOrNull,
                          RawServoDeclarationBlockBorrowed aDeclarations);
 
   already_AddRefed<RawServoAnimationValue>
   ComputeAnimationValue(RawServoDeclarationBlock* aDeclaration,
                         const ServoComputedValuesWithParent& aComputedValues);
 
-  void AppendTask(PostTraversalTask aTask)
-  {
-    MOZ_ASSERT(IsInServoTraversal());
-
-    // We currently only use PostTraversalTasks while the Servo font metrics
-    // mutex is locked.  If we need to use them in other situations during
-    // a traversal, we should assert that we've taken appropriate
-    // synchronization measures.
-    AssertIsMainThreadOrServoFontMetricsLocked();
-
-    mPostTraversalTasks.AppendElement(aTask);
-  }
-
 private:
-  // On construction, sets sInServoTraversal to the given ServoStyleSet.
-  // On destruction, clears sInServoTraversal and calls RunPostTraversalTasks.
-  class MOZ_STACK_CLASS AutoSetInServoTraversal
-  {
-  public:
-    AutoSetInServoTraversal(ServoStyleSet* aSet)
-      : mSet(aSet)
-    {
-      MOZ_ASSERT(!sInServoTraversal);
-      MOZ_ASSERT(aSet);
-      sInServoTraversal = aSet;
-    }
-
-    ~AutoSetInServoTraversal()
-    {
-      MOZ_ASSERT(sInServoTraversal);
-      sInServoTraversal = nullptr;
-      mSet->RunPostTraversalTasks();
-    }
-
-  private:
-    ServoStyleSet* mSet;
-  };
-
   already_AddRefed<nsStyleContext> GetContext(already_AddRefed<ServoComputedValues>,
                                               nsStyleContext* aParentContext,
                                               nsIAtom* aPseudoTag,
                                               CSSPseudoElementType aPseudoType,
                                               dom::Element* aElementForAnimation);
 
   already_AddRefed<nsStyleContext> GetContext(nsIContent* aContent,
                                               nsStyleContext* aParentContext,
@@ -395,18 +351,16 @@ private:
    */
   void PreTraverse(dom::Element* aRoot = nullptr);
   // Subset of the pre-traverse steps that involve syncing up data
   void PreTraverseSync();
 
   already_AddRefed<ServoComputedValues> ResolveStyleLazily(dom::Element* aElement,
                                                            nsIAtom* aPseudoTag);
 
-  void RunPostTraversalTasks();
-
   uint32_t FindSheetOfType(SheetType aType,
                            ServoStyleSheet* aSheet);
 
   uint32_t PrependSheetOfType(SheetType aType,
                               ServoStyleSheet* aSheet,
                               uint32_t aReuseUniqueID = 0);
 
   uint32_t AppendSheetOfType(SheetType aType,
@@ -440,20 +394,14 @@ private:
   bool mAuthorStyleDisabled;
 
   // Stores pointers to our cached style contexts for non-inheriting anonymous
   // boxes.
   EnumeratedArray<nsCSSAnonBoxes::NonInheriting,
                   nsCSSAnonBoxes::NonInheriting::_Count,
                   RefPtr<nsStyleContext>> mNonInheritingStyleContexts;
 
-  // Tasks to perform after a traversal, back on the main thread.
-  //
-  // These are similar to Servo's SequentialTasks, except that they are
-  // posted by C++ code running on style worker threads.
-  nsTArray<PostTraversalTask> mPostTraversalTasks;
-
-  static ServoStyleSet* sInServoTraversal;
+  static bool sInServoTraversal;
 };
 
 } // namespace mozilla
 
 #endif // mozilla_ServoStyleSet_h
--- a/layout/style/ServoUtils.h
+++ b/layout/style/ServoUtils.h
@@ -6,23 +6,16 @@
 
 /* some utilities for stylo */
 
 #ifndef mozilla_ServoUtils_h
 #define mozilla_ServoUtils_h
 
 #include "mozilla/TypeTraits.h"
 
-namespace mozilla {
-
-// Defined in ServoBindings.cpp.
-void AssertIsMainThreadOrServoFontMetricsLocked();
-
-} // namespace mozilla
-
 #ifdef MOZ_STYLO
 # define MOZ_DECL_STYLO_CHECK_METHODS \
   bool IsGecko() const { return !IsServo(); } \
   bool IsServo() const { return mType == StyleBackendType::Servo; }
 #else
 # define MOZ_DECL_STYLO_CHECK_METHODS \
   bool IsGecko() const { return true; } \
   bool IsServo() const { return false; }
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -88,17 +88,16 @@ EXPORTS.mozilla += [
     'DeclarationBlock.h',
     'DeclarationBlockInlines.h',
     'DocumentStyleRootIterator.h',
     'GenericSpecifiedValues.h',
     'GenericSpecifiedValuesInlines.h',
     'HandleRefPtr.h',
     'IncrementalClearCOMRuleArray.h',
     'LayerAnimationInfo.h',
-    'PostTraversalTask.h',
     'PreloadedStyleSheet.h',
     'RuleNodeCacheConditions.h',
     'RuleProcessorCache.h',
     'ServoArcTypeList.h',
     'ServoBindingList.h',
     'ServoBindings.h',
     'ServoBindingTypes.h',
     'ServoCSSRuleList.h',
@@ -215,17 +214,16 @@ UNIFIED_SOURCES += [
     'nsRuleNode.cpp',
     'nsStyleContext.cpp',
     'nsStyleCoord.cpp',
     'nsStyleSet.cpp',
     'nsStyleStruct.cpp',
     'nsStyleTransformMatrix.cpp',
     'nsStyleUtil.cpp',
     'nsTransitionManager.cpp',
-    'PostTraversalTask.cpp',
     'PreloadedStyleSheet.cpp',
     'RuleNodeCacheConditions.cpp',
     'RuleProcessorCache.cpp',
     'ServoBindings.cpp',
     'ServoCSSRuleList.cpp',
     'ServoDeclarationBlock.cpp',
     'ServoElementSnapshot.cpp',
     'ServoMediaList.cpp',
--- a/mfbt/WeakPtr.h
+++ b/mfbt/WeakPtr.h
@@ -107,21 +107,18 @@
   std::thread::id _owningThread; \
   bool _empty; // If it was initialized as a placeholder with mPtr = nullptr.
 #define MOZ_WEAKPTR_INIT_THREAD_SAFETY_CHECK() \
   do { \
     _owningThread = std::this_thread::get_id(); \
     _empty = !p; \
   } while (false)
 #define MOZ_WEAKPTR_ASSERT_THREAD_SAFETY() \
-  do { \
-    if (!(_empty || _owningThread == std::this_thread::get_id())) { \
-      WeakPtrTraits<T>::AssertSafeToAccessFromNonOwningThread(); \
-    } \
-  } while (false)
+  MOZ_DIAGNOSTIC_ASSERT(_empty || _owningThread == std::this_thread::get_id(), \
+                        "WeakPtr used on multiple threads")
 #define MOZ_WEAKPTR_ASSERT_THREAD_SAFETY_DELEGATED(that) \
   (that)->AssertThreadSafety();
 
 #define MOZ_WEAKPTR_THREAD_SAFETY_CHECKING 1
 
 #else
 
 #define MOZ_WEAKPTR_DECLARE_THREAD_SAFETY_CHECK
@@ -138,25 +135,16 @@ template <typename T> class SupportsWeak
 
 #ifdef MOZ_REFCOUNTED_LEAK_CHECKING
 #define MOZ_DECLARE_WEAKREFERENCE_TYPENAME(T) \
   static const char* weakReferenceTypeName() { return "WeakReference<" #T ">"; }
 #else
 #define MOZ_DECLARE_WEAKREFERENCE_TYPENAME(T)
 #endif
 
-template<class T>
-struct WeakPtrTraits
-{
-  static void AssertSafeToAccessFromNonOwningThread()
-  {
-    MOZ_DIAGNOSTIC_ASSERT(false, "WeakPtr accessed from multiple threads");
-  }
-};
-
 namespace detail {
 
 // This can live beyond the lifetime of the class derived from
 // SupportsWeakPtr.
 template<class T>
 class WeakReference : public ::mozilla::RefCounted<WeakReference<T> >
 {
 public:
--- a/parser/htmlparser/tests/reftest/reftest.list
+++ b/parser/htmlparser/tests/reftest/reftest.list
@@ -1,26 +1,26 @@
 == bug535530-1.html bug535530-1-ref.html
-== view-source:bug535530-2.html bug535530-2-ref.html
+fails-if(stylo) == view-source:bug535530-2.html bug535530-2-ref.html
 == bug566280-1.html bug566280-1-ref.html
 == bug569229-1.xml bug569229-1-ref.xml
 == bug577418-1.html bug577418-1-ref.html
 == bug582788-1.html bug582788-1-ref.html
 fuzzy-if(skiaContent,2,5) == bug582940-1.html bug582940-1-ref.html
 == bug592656-1.html bug592656-1-ref.html
 fuzzy-if(skiaContent,1,5) == bug599320-1.html bug599320-1-ref.html
 fuzzy-if(skiaContent,2,5) == bug608373-1.html bug608373-1-ref.html
-fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azureSkia,73,1) == view-source:bug482921-1.html bug482921-1-ref.html
-== view-source:bug482921-2.xhtml bug482921-2-ref.html
+fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azureSkia,73,1) fails-if(stylo) == view-source:bug482921-1.html bug482921-1-ref.html
+fails-if(stylo) == view-source:bug482921-2.xhtml bug482921-2-ref.html
 fuzzy-if(skiaContent,2,5) == bug659763-1.html bug659763-1-ref.html
 fuzzy-if(skiaContent,1,5) == bug659763-2.html bug659763-2-ref.html
 fuzzy-if(skiaContent,1,5) == bug659763-3.html bug659763-3-ref.html
 fuzzy-if(skiaContent,2,3) == bug659763-4.html bug659763-4-ref.html
 fuzzy-if(skiaContent,1,5) == bug659763-5.html bug659763-5-ref.html
 fuzzy-if(skiaContent,1,5) == bug659763-6.html bug659763-6-ref.html
-== view-source:bug673094-1.html view-source:bug673094-1-ref.html
+fails-if(stylo) == view-source:bug673094-1.html view-source:bug673094-1-ref.html
 == bug696651-1.html bug696651-1-ref.html
 == bug696651-2.html bug696651-2-ref.html
-== view-source:bug700260-1.html view-source:bug700260-1-ref.html
-== view-source:bug704667-1.html bug704667-1-ref.html
-== view-source:bug731234-1.html bug731234-1-ref.html
+fails-if(stylo) == view-source:bug700260-1.html view-source:bug700260-1-ref.html
+fails-if(stylo) == view-source:bug704667-1.html bug704667-1-ref.html
+fails-if(stylo) == view-source:bug731234-1.html bug731234-1-ref.html
 == bug820508-1.html bug820508-1-ref.html
-== view-source:bug910588-1.html bug910588-1-ref.html
+fails-if(stylo) == view-source:bug910588-1.html bug910588-1-ref.html