Bug 1438911: Avoid doing changeset changes off a runnable for stylo. r=bz

MozReview-Commit-ID: Kgu9OxjtY5v

--HG--
extra : rebase_source : ae14355731b10c026f526b564d7eee23a57d2da5
This commit is contained in:
Emilio Cobos Álvarez 2018-02-16 18:55:27 +01:00
parent 6dd24e93ac
commit 1300727b08

View File

@ -126,6 +126,8 @@ public:
nsPresContext* mPresContext;
};
#ifdef MOZ_OLD_STYLE
namespace {
class CharSetChangingRunnable : public Runnable
@ -152,6 +154,8 @@ private:
} // namespace
#endif
nscolor
nsPresContext::MakeColorPref(const nsString& aColor)
{
@ -1162,9 +1166,16 @@ nsPresContext::UpdateCharSet(NotNull<const Encoding*> aCharSet)
void
nsPresContext::DispatchCharSetChange(NotNull<const Encoding*> aEncoding)
{
RefPtr<CharSetChangingRunnable> runnable =
new CharSetChangingRunnable(this, aEncoding);
Document()->Dispatch(TaskCategory::Other, runnable.forget());
#ifdef MOZ_OLD_STYLE
if (!Document()->IsStyledByServo()) {
RefPtr<CharSetChangingRunnable> runnable =
new CharSetChangingRunnable(this, aEncoding);
Document()->Dispatch(TaskCategory::Other, runnable.forget());
return;
}
#endif
// In Servo RebuildAllStyleData is async, so no need to do the runnable dance.
DoChangeCharSet(aEncoding);
}
nsPresContext*