1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "PostTraversalTask.h"
9 #include "mozilla/dom/FontFace.h"
10 #include "mozilla/dom/FontFaceSet.h"
11 #include "gfxPlatformFontList.h"
12 #include "gfxTextRun.h"
13 #include "ServoStyleSet.h"
14 #include "nsPresContext.h"
20 void PostTraversalTask::Run() {
22 case Type::ResolveFontFaceLoadedPromise
:
23 static_cast<FontFace
*>(mTarget
)->DoResolve();
26 case Type::RejectFontFaceLoadedPromise
:
27 static_cast<FontFace
*>(mTarget
)->DoReject(mResult
);
30 case Type::DispatchLoadingEventAndReplaceReadyPromise
:
31 static_cast<FontFaceSet
*>(mTarget
)
32 ->DispatchLoadingEventAndReplaceReadyPromise();
35 case Type::DispatchFontFaceSetCheckLoadingFinishedAfterDelay
:
36 static_cast<FontFaceSet
*>(mTarget
)
37 ->DispatchCheckLoadingFinishedAfterDelay();
40 case Type::LoadFontEntry
:
41 static_cast<gfxUserFontEntry
*>(mTarget
)->ContinueLoad();
44 case Type::InitializeFamily
:
45 Unused
<< gfxPlatformFontList::PlatformFontList()->InitializeFamily(
46 static_cast<fontlist::Family
*>(mTarget
));
49 case Type::FontInfoUpdate
:
51 static_cast<ServoStyleSet
*>(mTarget
)->GetPresContext();
53 pc
->ForceReflowForFontInfoUpdate();
59 } // namespace mozilla